Comparing version 0.0.14 to 1.0.0
10
index.js
@@ -59,13 +59,13 @@ 'use strict' | ||
if (options.ignore && match && options.ignore.reduce((acc, curr) => { | ||
return acc || minimatch(relativeEntryPath, curr, options) | ||
}, false)) { | ||
const isDirectory = entry.isDirectory() | ||
if (isDirectory && options.nodir) { | ||
match = false | ||
} | ||
if (match && !(entry.isDirectory() && options.nodir)) { | ||
if (match) { | ||
yield options.absolute ? absoluteEntryPath : relativeEntryPath | ||
} | ||
if (entry.isDirectory()) { | ||
if (isDirectory) { | ||
yield * _glob(base, relativeEntryPath, pattern, options) | ||
@@ -72,0 +72,0 @@ } |
{ | ||
"name": "it-glob", | ||
"version": "0.0.14", | ||
"version": "1.0.0", | ||
"description": "Async iterable filename pattern matcher", | ||
@@ -36,3 +36,3 @@ "main": "index.js", | ||
"types": "dist/index.d.ts", | ||
"gitHead": "db98c14fcd41e4f17385c31d355f76f9050fa985" | ||
"gitHead": "c902ba944194fe330a33ac447435114c5397072d" | ||
} |
@@ -21,5 +21,2 @@ # it-glob | ||
const options = { | ||
ignore: [ | ||
'glob' // glob patterns to ignore | ||
], | ||
cwd // defaults to process.cwd | ||
@@ -36,1 +33,3 @@ absolute // return absolute paths, defaults to false | ||
``` | ||
See the [minimatch docs](https://www.npmjs.com/package/minimatch#options) for the full list of options. |
21
test.js
@@ -31,8 +31,3 @@ const test = require('ava') | ||
test('it should ignore files', async t => { | ||
const files = await all(glob('.', '**/*', { | ||
ignore: [ | ||
'*/index.js', | ||
'**/node_modules/**' | ||
] | ||
})) | ||
const files = await all(glob('.', '**/*!(*/index.js|**/node_modules/**)')) | ||
@@ -43,8 +38,3 @@ t.falsy(files.includes('test/index.js')) | ||
test('it should ignore files from absolute directory', async t => { | ||
const files = await all(glob(__dirname, '**/*', { | ||
ignore: [ | ||
'test/index.js', | ||
'**/node_modules/**' | ||
] | ||
})) | ||
const files = await all(glob(__dirname, '**/*!(test/index.js|)**/node_modules/**')) | ||
@@ -82,7 +72,8 @@ t.falsy(files.includes(path.resolve(__dirname, 'index.js'))) | ||
const files = await all(glob(__dirname, 'node_modules/**/*', { | ||
nodir: true | ||
nodir: true, | ||
dot: true | ||
})) | ||
t.falsy(files.includes('node_modules/it-all')) | ||
t.truthy(files.includes('node_modules/it-all/package.json')) | ||
t.falsy(files.includes('node_modules/.bin')) | ||
t.truthy(files.includes('node_modules/.bin/ava')) | ||
}) |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
0
7423
163
34