Comparing version 3.1.1 to 3.2.0
17
index.js
@@ -6,3 +6,3 @@ "use strict"; | ||
const {join, basename} = require("path"); | ||
const multimatch = require("multimatch"); | ||
const minimatch = require("minimatch"); | ||
@@ -27,3 +27,9 @@ const readdir = promisify(fs.readdir); | ||
if (!opts || !opts.exclude || !opts.exclude.length) return false; | ||
return Boolean(multimatch(basename(path), opts.exclude, opts.minimatch).length); | ||
const name = basename(path); | ||
for (const pattern of opts.exclude) { | ||
if (minimatch(name, pattern, opts.minimatch)) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
@@ -33,3 +39,8 @@ | ||
if (!opts || !opts.include || !opts.include.length || entry.isDirectory()) return true; | ||
return Boolean(multimatch(entry.name, opts.include, opts.minimatch).length); | ||
for (const pattern of opts.include) { | ||
if (minimatch(entry.name, pattern, opts.minimatch)) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
@@ -36,0 +47,0 @@ |
{ | ||
"name": "rrdir", | ||
"version": "3.1.1", | ||
"version": "3.2.0", | ||
"description": "Recursive directory reader with a delightful API", | ||
@@ -18,9 +18,9 @@ "author": "silverwind <me@silverwind.io>", | ||
"dependencies": { | ||
"multimatch": "^4.0.0" | ||
"minimatch": "^3.0.4" | ||
}, | ||
"devDependencies": { | ||
"eslint": "^5.16.0", | ||
"eslint-config-silverwind": "^2.1.3", | ||
"updates": "^8.0.2", | ||
"ver": "^4.2.0" | ||
"eslint": "6.2.2", | ||
"eslint-config-silverwind": "4.1.0", | ||
"updates": "8.5.3", | ||
"ver": "5.1.3" | ||
}, | ||
@@ -27,0 +27,0 @@ "keywords": [ |
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
9340
151
+ Addedminimatch@^3.0.4
- Removedmultimatch@^4.0.0
- Removed@types/minimatch@3.0.5(transitive)
- Removedarray-differ@3.0.0(transitive)
- Removedarray-union@2.1.0(transitive)
- Removedarrify@2.0.1(transitive)
- Removedmultimatch@4.0.0(transitive)