Update dist folder
This commit is contained in:
parent
c37839bdcb
commit
008d582ac3
|
|
@ -3244,17 +3244,17 @@ module.exports = require("util");
|
|||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.Glob = void 0;
|
||||
const minimatch_1 = __nccwpck_require__(266);
|
||||
const path_scurry_1 = __nccwpck_require__(1081);
|
||||
const minimatch_1 = __nccwpck_require__(658);
|
||||
const node_url_1 = __nccwpck_require__(1041);
|
||||
const path_scurry_1 = __nccwpck_require__(1081);
|
||||
const pattern_js_1 = __nccwpck_require__(6866);
|
||||
const walker_js_1 = __nccwpck_require__(153);
|
||||
// if no process global, just call it linux.
|
||||
// so we default to case-sensitive, / separators
|
||||
const defaultPlatform = typeof process === 'object' &&
|
||||
const defaultPlatform = (typeof process === 'object' &&
|
||||
process &&
|
||||
typeof process.platform === 'string'
|
||||
? process.platform
|
||||
typeof process.platform === 'string') ?
|
||||
process.platform
|
||||
: 'linux';
|
||||
/**
|
||||
* An object that can perform glob pattern traversals.
|
||||
|
|
@ -3284,6 +3284,7 @@ class Glob {
|
|||
signal;
|
||||
windowsPathsNoEscape;
|
||||
withFileTypes;
|
||||
includeChildMatches;
|
||||
/**
|
||||
* The options provided to the constructor.
|
||||
*/
|
||||
|
|
@ -3329,6 +3330,7 @@ class Glob {
|
|||
this.noext = !!opts.noext;
|
||||
this.realpath = !!opts.realpath;
|
||||
this.absolute = opts.absolute;
|
||||
this.includeChildMatches = opts.includeChildMatches !== false;
|
||||
this.noglobstar = !!opts.noglobstar;
|
||||
this.matchBase = !!opts.matchBase;
|
||||
this.maxDepth =
|
||||
|
|
@ -3343,7 +3345,8 @@ class Glob {
|
|||
}
|
||||
this.windowsPathsNoEscape =
|
||||
!!opts.windowsPathsNoEscape ||
|
||||
opts.allowWindowsEscape === false;
|
||||
opts.allowWindowsEscape ===
|
||||
false;
|
||||
if (this.windowsPathsNoEscape) {
|
||||
pattern = pattern.map(p => p.replace(/\\/g, '/'));
|
||||
}
|
||||
|
|
@ -3364,12 +3367,9 @@ class Glob {
|
|||
}
|
||||
}
|
||||
else {
|
||||
const Scurry = opts.platform === 'win32'
|
||||
? path_scurry_1.PathScurryWin32
|
||||
: opts.platform === 'darwin'
|
||||
? path_scurry_1.PathScurryDarwin
|
||||
: opts.platform
|
||||
? path_scurry_1.PathScurryPosix
|
||||
const Scurry = opts.platform === 'win32' ? path_scurry_1.PathScurryWin32
|
||||
: opts.platform === 'darwin' ? path_scurry_1.PathScurryDarwin
|
||||
: opts.platform ? path_scurry_1.PathScurryPosix
|
||||
: path_scurry_1.PathScurry;
|
||||
this.scurry = new Scurry(this.cwd, {
|
||||
nocase: opts.nocase,
|
||||
|
|
@ -3421,11 +3421,12 @@ class Glob {
|
|||
return [
|
||||
...(await new walker_js_1.GlobWalker(this.patterns, this.scurry.cwd, {
|
||||
...this.opts,
|
||||
maxDepth: this.maxDepth !== Infinity
|
||||
? this.maxDepth + this.scurry.cwd.depth()
|
||||
maxDepth: this.maxDepth !== Infinity ?
|
||||
this.maxDepth + this.scurry.cwd.depth()
|
||||
: Infinity,
|
||||
platform: this.platform,
|
||||
nocase: this.nocase,
|
||||
includeChildMatches: this.includeChildMatches,
|
||||
}).walk()),
|
||||
];
|
||||
}
|
||||
|
|
@ -3433,32 +3434,35 @@ class Glob {
|
|||
return [
|
||||
...new walker_js_1.GlobWalker(this.patterns, this.scurry.cwd, {
|
||||
...this.opts,
|
||||
maxDepth: this.maxDepth !== Infinity
|
||||
? this.maxDepth + this.scurry.cwd.depth()
|
||||
maxDepth: this.maxDepth !== Infinity ?
|
||||
this.maxDepth + this.scurry.cwd.depth()
|
||||
: Infinity,
|
||||
platform: this.platform,
|
||||
nocase: this.nocase,
|
||||
includeChildMatches: this.includeChildMatches,
|
||||
}).walkSync(),
|
||||
];
|
||||
}
|
||||
stream() {
|
||||
return new walker_js_1.GlobStream(this.patterns, this.scurry.cwd, {
|
||||
...this.opts,
|
||||
maxDepth: this.maxDepth !== Infinity
|
||||
? this.maxDepth + this.scurry.cwd.depth()
|
||||
maxDepth: this.maxDepth !== Infinity ?
|
||||
this.maxDepth + this.scurry.cwd.depth()
|
||||
: Infinity,
|
||||
platform: this.platform,
|
||||
nocase: this.nocase,
|
||||
includeChildMatches: this.includeChildMatches,
|
||||
}).stream();
|
||||
}
|
||||
streamSync() {
|
||||
return new walker_js_1.GlobStream(this.patterns, this.scurry.cwd, {
|
||||
...this.opts,
|
||||
maxDepth: this.maxDepth !== Infinity
|
||||
? this.maxDepth + this.scurry.cwd.depth()
|
||||
maxDepth: this.maxDepth !== Infinity ?
|
||||
this.maxDepth + this.scurry.cwd.depth()
|
||||
: Infinity,
|
||||
platform: this.platform,
|
||||
nocase: this.nocase,
|
||||
includeChildMatches: this.includeChildMatches,
|
||||
}).streamSync();
|
||||
}
|
||||
/**
|
||||
|
|
@ -3494,7 +3498,7 @@ exports.Glob = Glob;
|
|||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.hasMagic = void 0;
|
||||
const minimatch_1 = __nccwpck_require__(266);
|
||||
const minimatch_1 = __nccwpck_require__(658);
|
||||
/**
|
||||
* Return true if the patterns provided contain any magic glob characters,
|
||||
* given the options provided.
|
||||
|
|
@ -3532,12 +3536,12 @@ exports.hasMagic = hasMagic;
|
|||
// Ignores are always parsed in dot:true mode
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.Ignore = void 0;
|
||||
const minimatch_1 = __nccwpck_require__(266);
|
||||
const minimatch_1 = __nccwpck_require__(658);
|
||||
const pattern_js_1 = __nccwpck_require__(6866);
|
||||
const defaultPlatform = typeof process === 'object' &&
|
||||
const defaultPlatform = (typeof process === 'object' &&
|
||||
process &&
|
||||
typeof process.platform === 'string'
|
||||
? process.platform
|
||||
typeof process.platform === 'string') ?
|
||||
process.platform
|
||||
: 'linux';
|
||||
/**
|
||||
* Class used to process ignored patterns
|
||||
|
|
@ -3547,12 +3551,15 @@ class Ignore {
|
|||
relativeChildren;
|
||||
absolute;
|
||||
absoluteChildren;
|
||||
platform;
|
||||
mmopts;
|
||||
constructor(ignored, { nobrace, nocase, noext, noglobstar, platform = defaultPlatform, }) {
|
||||
this.relative = [];
|
||||
this.absolute = [];
|
||||
this.relativeChildren = [];
|
||||
this.absoluteChildren = [];
|
||||
const mmopts = {
|
||||
this.platform = platform;
|
||||
this.mmopts = {
|
||||
dot: true,
|
||||
nobrace,
|
||||
nocase,
|
||||
|
|
@ -3563,6 +3570,10 @@ class Ignore {
|
|||
nocomment: true,
|
||||
nonegate: true,
|
||||
};
|
||||
for (const ign of ignored)
|
||||
this.add(ign);
|
||||
}
|
||||
add(ign) {
|
||||
// this is a little weird, but it gives us a clean set of optimized
|
||||
// minimatch matchers, without getting tripped up if one of them
|
||||
// ends in /** inside a brace section, and it's only inefficient at
|
||||
|
|
@ -3575,8 +3586,7 @@ class Ignore {
|
|||
// for absolute-ness.
|
||||
// Yet another way, Minimatch could take an array of glob strings, and
|
||||
// a cwd option, and do the right thing.
|
||||
for (const ign of ignored) {
|
||||
const mm = new minimatch_1.Minimatch(ign, mmopts);
|
||||
const mm = new minimatch_1.Minimatch(ign, this.mmopts);
|
||||
for (let i = 0; i < mm.set.length; i++) {
|
||||
const parsed = mm.set[i];
|
||||
const globParts = mm.globParts[i];
|
||||
|
|
@ -3591,8 +3601,8 @@ class Ignore {
|
|||
globParts.shift();
|
||||
}
|
||||
/* c8 ignore stop */
|
||||
const p = new pattern_js_1.Pattern(parsed, globParts, 0, platform);
|
||||
const m = new minimatch_1.Minimatch(p.globString(), mmopts);
|
||||
const p = new pattern_js_1.Pattern(parsed, globParts, 0, this.platform);
|
||||
const m = new minimatch_1.Minimatch(p.globString(), this.mmopts);
|
||||
const children = globParts[globParts.length - 1] === '**';
|
||||
const absolute = p.isAbsolute();
|
||||
if (absolute)
|
||||
|
|
@ -3607,7 +3617,6 @@ class Ignore {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
ignored(p) {
|
||||
const fullpath = p.fullpath();
|
||||
const fullpaths = `${fullpath}/`;
|
||||
|
|
@ -3648,10 +3657,19 @@ exports.Ignore = Ignore;
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.glob = exports.hasMagic = exports.Glob = exports.unescape = exports.escape = exports.sync = exports.iterate = exports.iterateSync = exports.stream = exports.streamSync = exports.globIterate = exports.globIterateSync = exports.globSync = exports.globStream = exports.globStreamSync = void 0;
|
||||
const minimatch_1 = __nccwpck_require__(266);
|
||||
exports.glob = exports.sync = exports.iterate = exports.iterateSync = exports.stream = exports.streamSync = exports.globIterate = exports.globIterateSync = exports.globSync = exports.globStream = exports.globStreamSync = exports.Ignore = exports.hasMagic = exports.Glob = exports.unescape = exports.escape = void 0;
|
||||
const minimatch_1 = __nccwpck_require__(658);
|
||||
const glob_js_1 = __nccwpck_require__(2487);
|
||||
const has_magic_js_1 = __nccwpck_require__(3133);
|
||||
var minimatch_2 = __nccwpck_require__(658);
|
||||
Object.defineProperty(exports, "escape", ({ enumerable: true, get: function () { return minimatch_2.escape; } }));
|
||||
Object.defineProperty(exports, "unescape", ({ enumerable: true, get: function () { return minimatch_2.unescape; } }));
|
||||
var glob_js_2 = __nccwpck_require__(2487);
|
||||
Object.defineProperty(exports, "Glob", ({ enumerable: true, get: function () { return glob_js_2.Glob; } }));
|
||||
var has_magic_js_2 = __nccwpck_require__(3133);
|
||||
Object.defineProperty(exports, "hasMagic", ({ enumerable: true, get: function () { return has_magic_js_2.hasMagic; } }));
|
||||
var ignore_js_1 = __nccwpck_require__(9703);
|
||||
Object.defineProperty(exports, "Ignore", ({ enumerable: true, get: function () { return ignore_js_1.Ignore; } }));
|
||||
function globStreamSync(pattern, options = {}) {
|
||||
return new glob_js_1.Glob(pattern, options).streamSync();
|
||||
}
|
||||
|
|
@ -3686,15 +3704,6 @@ exports.sync = Object.assign(globSync, {
|
|||
stream: globStreamSync,
|
||||
iterate: globIterateSync,
|
||||
});
|
||||
/* c8 ignore start */
|
||||
var minimatch_2 = __nccwpck_require__(266);
|
||||
Object.defineProperty(exports, "escape", ({ enumerable: true, get: function () { return minimatch_2.escape; } }));
|
||||
Object.defineProperty(exports, "unescape", ({ enumerable: true, get: function () { return minimatch_2.unescape; } }));
|
||||
var glob_js_2 = __nccwpck_require__(2487);
|
||||
Object.defineProperty(exports, "Glob", ({ enumerable: true, get: function () { return glob_js_2.Glob; } }));
|
||||
var has_magic_js_2 = __nccwpck_require__(3133);
|
||||
Object.defineProperty(exports, "hasMagic", ({ enumerable: true, get: function () { return has_magic_js_2.hasMagic; } }));
|
||||
/* c8 ignore stop */
|
||||
exports.glob = Object.assign(glob_, {
|
||||
glob: glob_,
|
||||
globSync,
|
||||
|
|
@ -3725,7 +3734,7 @@ exports.glob.glob = exports.glob;
|
|||
// this is just a very light wrapper around 2 arrays with an offset index
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.Pattern = void 0;
|
||||
const minimatch_1 = __nccwpck_require__(266);
|
||||
const minimatch_1 = __nccwpck_require__(658);
|
||||
const isPatternList = (pl) => pl.length >= 1;
|
||||
const isGlobList = (gl) => gl.length >= 1;
|
||||
/**
|
||||
|
|
@ -3833,9 +3842,9 @@ class Pattern {
|
|||
globString() {
|
||||
return (this.#globString =
|
||||
this.#globString ||
|
||||
(this.#index === 0
|
||||
? this.isAbsolute()
|
||||
? this.#globList[0] + this.#globList.slice(1).join('/')
|
||||
(this.#index === 0 ?
|
||||
this.isAbsolute() ?
|
||||
this.#globList[0] + this.#globList.slice(1).join('/')
|
||||
: this.#globList.join('/')
|
||||
: this.#globList.slice(this.#index).join('/')));
|
||||
}
|
||||
|
|
@ -3864,8 +3873,8 @@ class Pattern {
|
|||
*/
|
||||
isUNC() {
|
||||
const pl = this.#patternList;
|
||||
return this.#isUNC !== undefined
|
||||
? this.#isUNC
|
||||
return this.#isUNC !== undefined ?
|
||||
this.#isUNC
|
||||
: (this.#isUNC =
|
||||
this.#platform === 'win32' &&
|
||||
this.#index === 0 &&
|
||||
|
|
@ -3886,8 +3895,8 @@ class Pattern {
|
|||
*/
|
||||
isDrive() {
|
||||
const pl = this.#patternList;
|
||||
return this.#isDrive !== undefined
|
||||
? this.#isDrive
|
||||
return this.#isDrive !== undefined ?
|
||||
this.#isDrive
|
||||
: (this.#isDrive =
|
||||
this.#platform === 'win32' &&
|
||||
this.#index === 0 &&
|
||||
|
|
@ -3903,8 +3912,8 @@ class Pattern {
|
|||
*/
|
||||
isAbsolute() {
|
||||
const pl = this.#patternList;
|
||||
return this.#isAbsolute !== undefined
|
||||
? this.#isAbsolute
|
||||
return this.#isAbsolute !== undefined ?
|
||||
this.#isAbsolute
|
||||
: (this.#isAbsolute =
|
||||
(pl[0] === '' && pl.length > 1) ||
|
||||
this.isDrive() ||
|
||||
|
|
@ -3915,8 +3924,8 @@ class Pattern {
|
|||
*/
|
||||
root() {
|
||||
const p = this.#patternList[0];
|
||||
return typeof p === 'string' && this.isAbsolute() && this.#index === 0
|
||||
? p
|
||||
return (typeof p === 'string' && this.isAbsolute() && this.#index === 0) ?
|
||||
p
|
||||
: '';
|
||||
}
|
||||
/**
|
||||
|
|
@ -3951,7 +3960,7 @@ exports.Pattern = Pattern;
|
|||
// synchronous utility for filtering entries and calculating subwalks
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.Processor = exports.SubWalks = exports.MatchRecord = exports.HasWalkedCache = void 0;
|
||||
const minimatch_1 = __nccwpck_require__(266);
|
||||
const minimatch_1 = __nccwpck_require__(658);
|
||||
/**
|
||||
* A cache of which patterns have been processed for a given Path
|
||||
*/
|
||||
|
|
@ -4052,9 +4061,8 @@ class Processor {
|
|||
this.opts = opts;
|
||||
this.follow = !!opts.follow;
|
||||
this.dot = !!opts.dot;
|
||||
this.hasWalkedCache = hasWalkedCache
|
||||
? hasWalkedCache.copy()
|
||||
: new HasWalkedCache();
|
||||
this.hasWalkedCache =
|
||||
hasWalkedCache ? hasWalkedCache.copy() : new HasWalkedCache();
|
||||
}
|
||||
processPatterns(target, patterns) {
|
||||
this.patterns = patterns;
|
||||
|
|
@ -4067,8 +4075,8 @@ class Processor {
|
|||
const absolute = pattern.isAbsolute() && this.opts.absolute !== false;
|
||||
// start absolute patterns at root
|
||||
if (root) {
|
||||
t = t.resolve(root === '/' && this.opts.root !== undefined
|
||||
? this.opts.root
|
||||
t = t.resolve(root === '/' && this.opts.root !== undefined ?
|
||||
this.opts.root
|
||||
: root);
|
||||
const rest = pattern.rest();
|
||||
if (!rest) {
|
||||
|
|
@ -4268,10 +4276,8 @@ exports.GlobStream = exports.GlobWalker = exports.GlobUtil = void 0;
|
|||
const minipass_1 = __nccwpck_require__(4968);
|
||||
const ignore_js_1 = __nccwpck_require__(9703);
|
||||
const processor_js_1 = __nccwpck_require__(4628);
|
||||
const makeIgnore = (ignore, opts) => typeof ignore === 'string'
|
||||
? new ignore_js_1.Ignore([ignore], opts)
|
||||
: Array.isArray(ignore)
|
||||
? new ignore_js_1.Ignore(ignore, opts)
|
||||
const makeIgnore = (ignore, opts) => typeof ignore === 'string' ? new ignore_js_1.Ignore([ignore], opts)
|
||||
: Array.isArray(ignore) ? new ignore_js_1.Ignore(ignore, opts)
|
||||
: ignore;
|
||||
/**
|
||||
* basic walking utilities that all the glob walker types use
|
||||
|
|
@ -4288,13 +4294,20 @@ class GlobUtil {
|
|||
#sep;
|
||||
signal;
|
||||
maxDepth;
|
||||
includeChildMatches;
|
||||
constructor(patterns, path, opts) {
|
||||
this.patterns = patterns;
|
||||
this.path = path;
|
||||
this.opts = opts;
|
||||
this.#sep = !opts.posix && opts.platform === 'win32' ? '\\' : '/';
|
||||
if (opts.ignore) {
|
||||
this.#ignore = makeIgnore(opts.ignore, opts);
|
||||
this.includeChildMatches = opts.includeChildMatches !== false;
|
||||
if (opts.ignore || !this.includeChildMatches) {
|
||||
this.#ignore = makeIgnore(opts.ignore ?? [], opts);
|
||||
if (!this.includeChildMatches &&
|
||||
typeof this.#ignore.add !== 'function') {
|
||||
const m = 'cannot ignore child matches, ignore lacks add() method.';
|
||||
throw new Error(m);
|
||||
}
|
||||
}
|
||||
// ignore, always set with maxDepth, but it's optional on the
|
||||
// GlobOptions type
|
||||
|
|
@ -4366,7 +4379,7 @@ class GlobUtil {
|
|||
return this.matchCheckTest(s, ifDir);
|
||||
}
|
||||
matchCheckTest(e, ifDir) {
|
||||
return e &&
|
||||
return (e &&
|
||||
(this.maxDepth === Infinity || e.depth() <= this.maxDepth) &&
|
||||
(!ifDir || e.canReaddir()) &&
|
||||
(!this.opts.nodir || !e.isDirectory()) &&
|
||||
|
|
@ -4374,8 +4387,8 @@ class GlobUtil {
|
|||
!this.opts.follow ||
|
||||
!e.isSymbolicLink() ||
|
||||
!e.realpathCached()?.isDirectory()) &&
|
||||
!this.#ignored(e)
|
||||
? e
|
||||
!this.#ignored(e)) ?
|
||||
e
|
||||
: undefined;
|
||||
}
|
||||
matchCheckSync(e, ifDir) {
|
||||
|
|
@ -4401,6 +4414,11 @@ class GlobUtil {
|
|||
matchFinish(e, absolute) {
|
||||
if (this.#ignored(e))
|
||||
return;
|
||||
// we know we have an ignore if this is false, but TS doesn't
|
||||
if (!this.includeChildMatches && this.#ignore?.add) {
|
||||
const ign = `${e.relativePosix()}/**`;
|
||||
this.#ignore.add(ign);
|
||||
}
|
||||
const abs = this.opts.absolute === undefined ? absolute : this.opts.absolute;
|
||||
this.seen.add(e);
|
||||
const mark = this.opts.mark && e.isDirectory() ? this.#sep : '';
|
||||
|
|
@ -4414,8 +4432,8 @@ class GlobUtil {
|
|||
}
|
||||
else {
|
||||
const rel = this.opts.posix ? e.relativePosix() : e.relative();
|
||||
const pre = this.opts.dotRelative && !rel.startsWith('..' + this.#sep)
|
||||
? '.' + this.#sep
|
||||
const pre = this.opts.dotRelative && !rel.startsWith('..' + this.#sep) ?
|
||||
'.' + this.#sep
|
||||
: '';
|
||||
this.matchEmit(!rel ? '.' + mark : pre + rel + mark);
|
||||
}
|
||||
|
|
@ -4555,10 +4573,9 @@ class GlobUtil {
|
|||
}
|
||||
exports.GlobUtil = GlobUtil;
|
||||
class GlobWalker extends GlobUtil {
|
||||
matches;
|
||||
matches = new Set();
|
||||
constructor(patterns, path, opts) {
|
||||
super(patterns, path, opts);
|
||||
this.matches = new Set();
|
||||
}
|
||||
matchEmit(e) {
|
||||
this.matches.add(e);
|
||||
|
|
@ -4637,7 +4654,7 @@ exports.GlobStream = GlobStream;
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 5934:
|
||||
/***/ 2401:
|
||||
/***/ ((__unused_webpack_module, exports) => {
|
||||
|
||||
"use strict";
|
||||
|
|
@ -4658,7 +4675,7 @@ exports.assertValidPattern = assertValidPattern;
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 7642:
|
||||
/***/ 6034:
|
||||
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
||||
|
||||
"use strict";
|
||||
|
|
@ -4666,15 +4683,15 @@ exports.assertValidPattern = assertValidPattern;
|
|||
// parse a single path portion
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.AST = void 0;
|
||||
const brace_expressions_js_1 = __nccwpck_require__(314);
|
||||
const unescape_js_1 = __nccwpck_require__(9820);
|
||||
const brace_expressions_js_1 = __nccwpck_require__(3096);
|
||||
const unescape_js_1 = __nccwpck_require__(7226);
|
||||
const types = new Set(['!', '?', '+', '*', '@']);
|
||||
const isExtglobType = (c) => types.has(c);
|
||||
// Patterns that get prepended to bind to the start of either the
|
||||
// entire string, or just a single path portion, to prevent dots
|
||||
// and/or traversal patterns, when needed.
|
||||
// Exts don't need the ^ or / bit, because the root binds that already.
|
||||
const startNoTraversal = '(?!\\.\\.?(?:$|/))';
|
||||
const startNoTraversal = '(?!(?:^|/)\\.\\.?(?:$|/))';
|
||||
const startNoDot = '(?!\\.)';
|
||||
// characters that indicate a start of pattern needs the "no dots" bit,
|
||||
// because a dot *might* be matched. ( is not in the list, because in
|
||||
|
|
@ -5002,6 +5019,9 @@ class AST {
|
|||
_glob: glob,
|
||||
});
|
||||
}
|
||||
get options() {
|
||||
return this.#options;
|
||||
}
|
||||
// returns the string match, the regexp source, whether there's magic
|
||||
// in the regexp (so a regular expression is required) and whether or
|
||||
// not the uflag is needed for the regular expression (for posix classes)
|
||||
|
|
@ -5071,7 +5091,8 @@ class AST {
|
|||
// - Since the start for a join is eg /(?!\.) and the start for a part
|
||||
// is ^(?!\.), we can just prepend (?!\.) to the pattern (either root
|
||||
// or start or whatever) and prepend ^ or / at the Regexp construction.
|
||||
toRegExpSource() {
|
||||
toRegExpSource(allowDot) {
|
||||
const dot = allowDot ?? !!this.#options.dot;
|
||||
if (this.#root === this)
|
||||
this.#fillNegs();
|
||||
if (!this.type) {
|
||||
|
|
@ -5080,7 +5101,7 @@ class AST {
|
|||
.map(p => {
|
||||
const [re, _, hasMagic, uflag] = typeof p === 'string'
|
||||
? AST.#parseGlob(p, this.#hasMagic, noEmpty)
|
||||
: p.toRegExpSource();
|
||||
: p.toRegExpSource(allowDot);
|
||||
this.#hasMagic = this.#hasMagic || hasMagic;
|
||||
this.#uflag = this.#uflag || uflag;
|
||||
return re;
|
||||
|
|
@ -5100,14 +5121,14 @@ class AST {
|
|||
// and prevent that.
|
||||
const needNoTrav =
|
||||
// dots are allowed, and the pattern starts with [ or .
|
||||
(this.#options.dot && aps.has(src.charAt(0))) ||
|
||||
(dot && aps.has(src.charAt(0))) ||
|
||||
// the pattern starts with \., and then [ or .
|
||||
(src.startsWith('\\.') && aps.has(src.charAt(2))) ||
|
||||
// the pattern starts with \.\., and then [ or .
|
||||
(src.startsWith('\\.\\.') && aps.has(src.charAt(4)));
|
||||
// no need to prevent dots if it can't match a dot, or if a
|
||||
// sub-pattern will be preventing it anyway.
|
||||
const needNoDot = !this.#options.dot && aps.has(src.charAt(0));
|
||||
const needNoDot = !dot && !allowDot && aps.has(src.charAt(0));
|
||||
start = needNoTrav ? startNoTraversal : needNoDot ? startNoDot : '';
|
||||
}
|
||||
}
|
||||
|
|
@ -5127,23 +5148,13 @@ class AST {
|
|||
this.#uflag,
|
||||
];
|
||||
}
|
||||
// We need to calculate the body *twice* if it's a repeat pattern
|
||||
// at the start, once in nodot mode, then again in dot mode, so a
|
||||
// pattern like *(?) can match 'x.y'
|
||||
const repeated = this.type === '*' || this.type === '+';
|
||||
// some kind of extglob
|
||||
const start = this.type === '!' ? '(?:(?!(?:' : '(?:';
|
||||
const body = this.#parts
|
||||
.map(p => {
|
||||
// extglob ASTs should only contain parent ASTs
|
||||
/* c8 ignore start */
|
||||
if (typeof p === 'string') {
|
||||
throw new Error('string type in extglob ast??');
|
||||
}
|
||||
/* c8 ignore stop */
|
||||
// can ignore hasMagic, because extglobs are already always magic
|
||||
const [re, _, _hasMagic, uflag] = p.toRegExpSource();
|
||||
this.#uflag = this.#uflag || uflag;
|
||||
return re;
|
||||
})
|
||||
.filter(p => !(this.isStart() && this.isEnd()) || !!p)
|
||||
.join('|');
|
||||
let body = this.#partsToRegExp(dot);
|
||||
if (this.isStart() && this.isEnd() && !body && this.type !== '!') {
|
||||
// invalid extglob, has to at least be *something* present, if it's
|
||||
// the entire path portion.
|
||||
|
|
@ -5153,21 +5164,36 @@ class AST {
|
|||
this.#hasMagic = undefined;
|
||||
return [s, (0, unescape_js_1.unescape)(this.toString()), false, false];
|
||||
}
|
||||
// XXX abstract out this map method
|
||||
let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot
|
||||
? ''
|
||||
: this.#partsToRegExp(true);
|
||||
if (bodyDotAllowed === body) {
|
||||
bodyDotAllowed = '';
|
||||
}
|
||||
if (bodyDotAllowed) {
|
||||
body = `(?:${body})(?:${bodyDotAllowed})*?`;
|
||||
}
|
||||
// an empty !() is exactly equivalent to a starNoEmpty
|
||||
let final = '';
|
||||
if (this.type === '!' && this.#emptyExt) {
|
||||
final =
|
||||
(this.isStart() && !this.#options.dot ? startNoDot : '') + starNoEmpty;
|
||||
final = (this.isStart() && !dot ? startNoDot : '') + starNoEmpty;
|
||||
}
|
||||
else {
|
||||
const close = this.type === '!'
|
||||
? // !() must match something,but !(x) can match ''
|
||||
'))' +
|
||||
(this.isStart() && !this.#options.dot ? startNoDot : '') +
|
||||
(this.isStart() && !dot && !allowDot ? startNoDot : '') +
|
||||
star +
|
||||
')'
|
||||
: this.type === '@'
|
||||
? ')'
|
||||
: this.type === '?'
|
||||
? ')?'
|
||||
: this.type === '+' && bodyDotAllowed
|
||||
? ')'
|
||||
: this.type === '*' && bodyDotAllowed
|
||||
? `)?`
|
||||
: `)${this.type}`;
|
||||
final = start + body + close;
|
||||
}
|
||||
|
|
@ -5178,6 +5204,23 @@ class AST {
|
|||
this.#uflag,
|
||||
];
|
||||
}
|
||||
#partsToRegExp(dot) {
|
||||
return this.#parts
|
||||
.map(p => {
|
||||
// extglob ASTs should only contain parent ASTs
|
||||
/* c8 ignore start */
|
||||
if (typeof p === 'string') {
|
||||
throw new Error('string type in extglob ast??');
|
||||
}
|
||||
/* c8 ignore stop */
|
||||
// can ignore hasMagic, because extglobs are already always magic
|
||||
const [re, _, _hasMagic, uflag] = p.toRegExpSource(dot);
|
||||
this.#uflag = this.#uflag || uflag;
|
||||
return re;
|
||||
})
|
||||
.filter(p => !(this.isStart() && this.isEnd()) || !!p)
|
||||
.join('|');
|
||||
}
|
||||
static #parseGlob(glob, hasMagic, noEmpty = false) {
|
||||
let escaping = false;
|
||||
let re = '';
|
||||
|
|
@ -5231,7 +5274,7 @@ exports.AST = AST;
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 314:
|
||||
/***/ 3096:
|
||||
/***/ ((__unused_webpack_module, exports) => {
|
||||
|
||||
"use strict";
|
||||
|
|
@ -5390,7 +5433,7 @@ exports.parseClass = parseClass;
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 1477:
|
||||
/***/ 1496:
|
||||
/***/ ((__unused_webpack_module, exports) => {
|
||||
|
||||
"use strict";
|
||||
|
|
@ -5419,7 +5462,7 @@ exports.escape = escape;
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 266:
|
||||
/***/ 658:
|
||||
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
||||
|
||||
"use strict";
|
||||
|
|
@ -5430,10 +5473,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.unescape = exports.escape = exports.AST = exports.Minimatch = exports.match = exports.makeRe = exports.braceExpand = exports.defaults = exports.filter = exports.GLOBSTAR = exports.sep = exports.minimatch = void 0;
|
||||
const brace_expansion_1 = __importDefault(__nccwpck_require__(1046));
|
||||
const assert_valid_pattern_js_1 = __nccwpck_require__(5934);
|
||||
const ast_js_1 = __nccwpck_require__(7642);
|
||||
const escape_js_1 = __nccwpck_require__(1477);
|
||||
const unescape_js_1 = __nccwpck_require__(9820);
|
||||
const assert_valid_pattern_js_1 = __nccwpck_require__(2401);
|
||||
const ast_js_1 = __nccwpck_require__(6034);
|
||||
const escape_js_1 = __nccwpck_require__(1496);
|
||||
const unescape_js_1 = __nccwpck_require__(7226);
|
||||
const minimatch = (p, pattern, options = {}) => {
|
||||
(0, assert_valid_pattern_js_1.assertValidPattern)(pattern);
|
||||
// shortcut: comments match nothing.
|
||||
|
|
@ -5769,6 +5812,7 @@ class Minimatch {
|
|||
globParts = this.levelOneOptimize(globParts);
|
||||
}
|
||||
else {
|
||||
// just collapse multiple ** portions into one
|
||||
globParts = this.adjascentGlobstarOptimize(globParts);
|
||||
}
|
||||
return globParts;
|
||||
|
|
@ -6258,7 +6302,11 @@ class Minimatch {
|
|||
fastTest = dotStarTest;
|
||||
}
|
||||
const re = ast_js_1.AST.fromGlob(pattern, this.options).toMMPattern();
|
||||
return fastTest ? Object.assign(re, { test: fastTest }) : re;
|
||||
if (fastTest && typeof re === 'object') {
|
||||
// Avoids overriding in frozen environments
|
||||
Reflect.defineProperty(re, 'test', { value: fastTest });
|
||||
}
|
||||
return re;
|
||||
}
|
||||
makeRe() {
|
||||
if (this.regexp || this.regexp === false)
|
||||
|
|
@ -6422,11 +6470,11 @@ class Minimatch {
|
|||
}
|
||||
exports.Minimatch = Minimatch;
|
||||
/* c8 ignore start */
|
||||
var ast_js_2 = __nccwpck_require__(7642);
|
||||
var ast_js_2 = __nccwpck_require__(6034);
|
||||
Object.defineProperty(exports, "AST", ({ enumerable: true, get: function () { return ast_js_2.AST; } }));
|
||||
var escape_js_2 = __nccwpck_require__(1477);
|
||||
var escape_js_2 = __nccwpck_require__(1496);
|
||||
Object.defineProperty(exports, "escape", ({ enumerable: true, get: function () { return escape_js_2.escape; } }));
|
||||
var unescape_js_2 = __nccwpck_require__(9820);
|
||||
var unescape_js_2 = __nccwpck_require__(7226);
|
||||
Object.defineProperty(exports, "unescape", ({ enumerable: true, get: function () { return unescape_js_2.unescape; } }));
|
||||
/* c8 ignore stop */
|
||||
exports.minimatch.AST = ast_js_1.AST;
|
||||
|
|
@ -6437,7 +6485,7 @@ exports.minimatch.unescape = unescape_js_1.unescape;
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 9820:
|
||||
/***/ 7226:
|
||||
/***/ ((__unused_webpack_module, exports) => {
|
||||
|
||||
"use strict";
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue