Comparing version 3.0.4 to 3.0.5
33
index.js
@@ -62,11 +62,10 @@ "use strict"; | ||
} catch (err) { | ||
if (opts.strict) { | ||
throw err; | ||
} else { | ||
results.push({path, err}); | ||
} | ||
if (opts.strict) throw err; | ||
results.push({path, err}); | ||
} | ||
if (stats) results.push(build(entry, path, stats)); | ||
} else { | ||
results.push(build(entry, path)); | ||
} | ||
results.push(build(entry, path, stats)); | ||
if (entry.isDirectory()) results.push(...await rrdir(path, opts)); | ||
@@ -104,11 +103,10 @@ } | ||
} catch (err) { | ||
if (opts.strict) { | ||
throw err; | ||
} else { | ||
results.push({path, err}); | ||
} | ||
if (opts.strict) throw err; | ||
results.push({path, err}); | ||
} | ||
if (stats) results.push(build(entry, path, stats)); | ||
} else { | ||
results.push(build(entry, path)); | ||
} | ||
results.push(build(entry, path, stats)); | ||
if (entry.isDirectory()) results.push(...rrdir.sync(path, opts)); | ||
@@ -145,13 +143,12 @@ } | ||
} catch (err) { | ||
if (opts.strict) { | ||
throw err; | ||
} else { | ||
yield {path, err}; | ||
} | ||
if (opts.strict) throw err; | ||
yield {path, err}; | ||
} | ||
if (stats) yield build(entry, path, stats); | ||
} else { | ||
yield build(entry, path); | ||
} | ||
yield build(entry, path, stats); | ||
if (entry.isDirectory()) yield* await rrdir.stream(path, opts); | ||
} | ||
}; |
{ | ||
"name": "rrdir", | ||
"version": "3.0.4", | ||
"version": "3.0.5", | ||
"description": "Recursive directory crawler with a delightful API", | ||
@@ -5,0 +5,0 @@ "author": "silverwind <me@silverwind.io>", |
@@ -33,3 +33,3 @@ # rrdir | ||
Recursively crawls a directory for entries contained within. By default, errors while reading files will be ignored and put in `entry.err`. The functions can throw on other unexpected conditions. `rrdir` and `rrdir.sync` return an array of `entry`, `rrdir.stream` is a async iterator which yields `entry`. | ||
Recursively crawls a directory for entries contained within. `rrdir` and `rrdir.sync` return an array of `entry`, `rrdir.stream` is a async iterator which yields `entry`. By default, errors while reading files will be ignored and put in `entry.err`. | ||
@@ -36,0 +36,0 @@ #### `options` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8128
129