Skip to content

Commit

Permalink
Add lazy option
Browse files Browse the repository at this point in the history
  • Loading branch information
Mao Mao committed Feb 16, 2015
1 parent 05c4e6b commit 0989244
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/find.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ find = module.exports.async = (source, options, cb , depth = 0 ) ->
list = []
# Check the current file through filter options
filter.async source, depth, options, (ok) ->
return cb null, list unless ok
return cb null, list unless options.lazy and ok
list.push source
# check source entry
stat = if options.dereference? then fs.stat else fs.lstat
Expand Down Expand Up @@ -80,7 +80,7 @@ find = module.exports.async = (source, options, cb , depth = 0 ) ->
# If anything out of order happened.
findSync = module.exports.sync = (source, options = {}, depth = 0) ->
list = []
return list unless filter.sync source, depth, options
return list unless options.lazy and filter.sync source, depth, options
# Check the current file through filter options
list.push source
# check source entry
Expand Down

0 comments on commit 0989244

Please sign in to comment.