Comparing version 4.0.1 to 5.0.0
16
index.js
@@ -5,3 +5,3 @@ "use strict"; | ||
const {readdirSync, statSync, lstatSync} = require("fs"); | ||
const {join, basename} = require("path"); | ||
const {join} = require("path"); | ||
const picomatch = require("picomatch"); | ||
@@ -18,3 +18,3 @@ | ||
dot: true, | ||
} | ||
}, | ||
}; | ||
@@ -24,8 +24,8 @@ | ||
if (!matcher) return false; | ||
return matcher(basename(path)); | ||
return matcher(path); | ||
} | ||
function isIncluded(entry, matcher) { | ||
function isIncluded(path, entry, matcher) { | ||
if (!matcher || entry.isDirectory()) return true; | ||
return matcher(entry.name); | ||
return matcher(path); | ||
} | ||
@@ -81,3 +81,3 @@ | ||
if (isExcluded(path, excludeMatcher)) continue; | ||
if (!isIncluded(entry, includeMatcher)) continue; | ||
if (!isIncluded(path, entry, includeMatcher)) continue; | ||
@@ -124,3 +124,3 @@ let stats; | ||
if (isExcluded(path, excludeMatcher)) continue; | ||
if (!isIncluded(entry, includeMatcher)) continue; | ||
if (!isIncluded(path, entry, includeMatcher)) continue; | ||
@@ -166,3 +166,3 @@ let stats; | ||
if (isExcluded(path, excludeMatcher)) continue; | ||
if (!isIncluded(entry, includeMatcher)) continue; | ||
if (!isIncluded(path, entry, includeMatcher)) continue; | ||
@@ -169,0 +169,0 @@ let stats; |
{ | ||
"name": "rrdir", | ||
"version": "4.0.1", | ||
"version": "5.0.0", | ||
"description": "Recursive directory reader with a delightful API", | ||
@@ -22,3 +22,3 @@ "author": "silverwind <me@silverwind.io>", | ||
"eslint": "6.8.0", | ||
"eslint-config-silverwind": "6.0.2", | ||
"eslint-config-silverwind": "7.1.0", | ||
"updates": "9.3.3", | ||
@@ -25,0 +25,0 @@ "versions": "7.0.5" |
@@ -47,2 +47,4 @@ # rrdir | ||
`include` and `exclude` globs match against the full directory, to match individial files by name, use `**/filename` or `**/*.js`. | ||
#### `entry` | ||
@@ -49,0 +51,0 @@ |
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
9673
58