@artus/core
Advanced tools
Comparing version 2.0.0-alpha.5 to 2.0.0-alpha.6
@@ -27,3 +27,4 @@ "use strict"; | ||
const extname = path_1.default.extname(realPath); | ||
if ((0, utils_1.isExclude)(item, extname, options.exclude, options.extensions)) { | ||
const relativePath = path_1.default.relative(baseDir, realPath); | ||
if ((0, utils_1.isExclude)(relativePath, options.exclude, options.extensions)) { | ||
return []; | ||
@@ -30,0 +31,0 @@ } |
@@ -8,3 +8,3 @@ import 'reflect-metadata'; | ||
export declare const existsAsync: (filePath: string) => Promise<boolean>; | ||
export declare const isExclude: (filename: string, extname: string, exclude: string[], extensions: string[]) => boolean; | ||
export declare const isExclude: (targetPath: string, exclude: string[], extensions: string[]) => boolean; | ||
export declare const isPluginAsync: (basePath: string) => Promise<boolean>; | ||
@@ -11,0 +11,0 @@ export declare const loadConfigItemList: <T = Record<string, any>>(configItemList: ManifestItem[], scanCtx: ScanContext) => Promise<Record<string, T>>; |
@@ -36,7 +36,8 @@ "use strict"; | ||
exports.existsAsync = existsAsync; | ||
const isExclude = (filename, extname, exclude, extensions) => { | ||
const isExclude = (targetPath, exclude, extensions) => { | ||
let result = false; | ||
if (!result && exclude) { | ||
result = (0, utils_1.isMatch)(filename, exclude); | ||
result = (0, utils_1.isMatch)(targetPath, exclude, true); | ||
} | ||
const extname = path.extname(targetPath); | ||
if (!result && extname) { | ||
@@ -43,0 +44,0 @@ result = !extensions.includes(extname); |
export declare function getDefaultExtensions(): string[]; | ||
export declare function isMatch(filename: string, patterns: string | string[]): boolean; | ||
export declare function isMatch(filename: string, patterns: string | string[], matchBase?: boolean): boolean; |
@@ -10,8 +10,8 @@ "use strict"; | ||
exports.getDefaultExtensions = getDefaultExtensions; | ||
function isMatch(filename, patterns) { | ||
function isMatch(filename, patterns, matchBase = false) { | ||
if (!Array.isArray(patterns)) { | ||
patterns = [patterns]; | ||
} | ||
return patterns.some(pattern => (0, minimatch_1.default)(filename, pattern)); | ||
return patterns.some(pattern => (0, minimatch_1.default)(filename, pattern), { matchBase }); | ||
} | ||
exports.isMatch = isMatch; |
{ | ||
"name": "@artus/core", | ||
"version": "2.0.0-alpha.5", | ||
"version": "2.0.0-alpha.6", | ||
"description": "Core package of Artus", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
118741
2853
0