@midwayjs/glob
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -12,5 +12,8 @@ "use strict"; | ||
}); | ||
return globDirectory(entryDir, isMatch, options); | ||
const ignoreMatch = pm('**', { | ||
ignore: options.ignore || [] | ||
}); | ||
return globDirectory(entryDir, isMatch, ignoreMatch, options); | ||
}; | ||
const globDirectory = (dirname, isMatch, options) => { | ||
const globDirectory = (dirname, isMatch, ignoreDirMatch, options) => { | ||
if (!fs_1.existsSync(dirname)) { | ||
@@ -24,4 +27,4 @@ return []; | ||
const fileStat = fs_1.statSync(resolvePath); | ||
if (fileStat.isDirectory() && isMatch(resolvePath)) { | ||
const childs = globDirectory(resolvePath, isMatch, options); | ||
if (fileStat.isDirectory() && ignoreDirMatch(resolvePath)) { | ||
const childs = globDirectory(resolvePath, isMatch, ignoreDirMatch, options); | ||
result.push(...childs); | ||
@@ -35,2 +38,2 @@ } | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsMkJBQXVEO0FBQ3ZELCtCQUErQjtBQUMvQixnQ0FBZ0M7QUFPbkIsUUFBQSxHQUFHLEdBQUcsQ0FBQyxPQUFpQixFQUFFLFVBQXNCLEVBQUUsR0FBRyxFQUFFLE9BQU8sQ0FBQyxHQUFHLEVBQUUsRUFBRSxNQUFNLEVBQUUsRUFBRSxFQUFFLEVBQUUsRUFBRTtJQUNqRyxNQUFNLFFBQVEsR0FBRyxPQUFPLENBQUMsR0FBRyxDQUFDO0lBQzdCLE1BQU0sT0FBTyxHQUFHLEVBQUUsQ0FBQyxPQUFPLEVBQUU7UUFDMUIsTUFBTSxFQUFFLE9BQU8sQ0FBQyxNQUFNLElBQUksRUFBRTtLQUM3QixDQUFDLENBQUM7SUFDSCxPQUFPLGFBQW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BSSxJQUFJLElBQUksRUFBRTtRQUNyQixNQUFNLFdBQVcsR0FBRyxjQUFPLENBQUMsT0FBTyxFQUFFLElBQUksQ0FBQyxDQUFDO1FBQzNDLE1BQU0sUUFBUSxHQUFHLGFBQVEsQ0FBQyxXQUFXLENBQUMsQ0FBQztRQUN2QyxJQUFJLFFBQVEsQ0FBQyxXQUFXLEVBQUUsSUFBSSxjQUFjLENBQUMsV0FBVyxDQUFDLEVBQUU7WUFDekQsTUFBTSxNQUFNLEdBQUcsYUFBYSxDQUFDLFdBQVcsRUFBRSxPQUFPLEVBQUUsY0FBYyxFQUFFLE9BQU8sQ0FBQyxDQUFDO1lBQzVFLE1BQU0sQ0FBQyxJQUFJLENBQUMsR0FBRyxNQUFNLENBQUMsQ0FBQztTQUN4QjthQUFNLElBQUcsUUFBUSxDQUFDLE1BQU0sRUFBRSxJQUFJLE9BQU8sQ0FBQyxXQUFXLENBQUMsRUFBRTtZQUNuRCxNQUFNLENBQUMsSUFBSSxDQUFDLFdBQVcsQ0FBQyxDQUFDO1NBQzFCO0tBQ0Y7SUFFRCxPQUFPLE1BQU0sQ0FBQztBQUNoQixDQUFDLENBQUMifQ== |
{ | ||
"name": "@midwayjs/glob", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"main": "dist/index", | ||
@@ -5,0 +5,0 @@ "typings": "dist/index.d.ts", |
@@ -10,6 +10,7 @@ # midway easy glob tools | ||
const result = run(['**/*.md', '!**/bbbb/**'], { | ||
const result = run(['**/*.md'], { | ||
cwd: join(__dirname, './fixtures/first'), | ||
ignore: [ | ||
'**/c.md' | ||
'**/c.md', | ||
'**/bbbb/**' | ||
] | ||
@@ -16,0 +17,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
4162
5
40
19