UNPKG

@modern-js/utils

Version:

A Progressive React Framework for modern web development.

1,261 lines 188 kB
/*! LICENSE: index.js.LICENSE.txt */ (()=>{ var t = { 6491: (t, e, r)=>{ "use strict"; Object.defineProperty(e, "__esModule", { value: true }); e.createFileSystemAdapter = e.FILE_SYSTEM_ADAPTER = void 0; const n = r(7147); e.FILE_SYSTEM_ADAPTER = { lstat: n.lstat, stat: n.stat, lstatSync: n.lstatSync, statSync: n.statSync, readdir: n.readdir, readdirSync: n.readdirSync }; function createFileSystemAdapter(t) { if (void 0 === t) return e.FILE_SYSTEM_ADAPTER; return Object.assign(Object.assign({}, e.FILE_SYSTEM_ADAPTER), t); } e.createFileSystemAdapter = createFileSystemAdapter; }, 6325: (t, e)=>{ "use strict"; Object.defineProperty(e, "__esModule", { value: true }); e.IS_SUPPORT_READDIR_WITH_FILE_TYPES = void 0; const r = process.versions.node.split("."); if (void 0 === r[0] || void 0 === r[1]) throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`); const n = Number.parseInt(r[0], 10); const s = Number.parseInt(r[1], 10); const i = 10; const o = 10; const a = n > i; const u = n === i && s >= o; e.IS_SUPPORT_READDIR_WITH_FILE_TYPES = a || u; }, 1659: (t, e, r)=>{ "use strict"; Object.defineProperty(e, "__esModule", { value: true }); e.Settings = e.scandirSync = e.scandir = void 0; const n = r(4715); const s = r(8907); const i = r(3486); e.Settings = i.default; function scandir(t, e, r) { if ("function" == typeof e) return void n.read(t, getSettings(), e); n.read(t, getSettings(e), r); } e.scandir = scandir; function scandirSync(t, e) { const r = getSettings(e); return s.read(t, r); } e.scandirSync = scandirSync; function getSettings(t = {}) { if (t instanceof i.default) return t; return new i.default(t); } }, 4715: (t, e, r)=>{ "use strict"; Object.defineProperty(e, "__esModule", { value: true }); e.readdir = e.readdirWithFileTypes = e.read = void 0; const n = r(3645); const s = r(5341); const i = r(6325); const o = r(946); const a = r(3253); function read(t, e, r) { if (!e.stats && i.IS_SUPPORT_READDIR_WITH_FILE_TYPES) return void readdirWithFileTypes(t, e, r); readdir(t, e, r); } e.read = read; function readdirWithFileTypes(t, e, r) { e.fs.readdir(t, { withFileTypes: true }, (n, i)=>{ if (null !== n) return void callFailureCallback(r, n); const o = i.map((r)=>({ dirent: r, name: r.name, path: a.joinPathSegments(t, r.name, e.pathSegmentSeparator) })); if (!e.followSymbolicLinks) return void callSuccessCallback(r, o); const u = o.map((t)=>makeRplTaskEntry(t, e)); s(u, (t, e)=>{ if (null !== t) return void callFailureCallback(r, t); callSuccessCallback(r, e); }); }); } e.readdirWithFileTypes = readdirWithFileTypes; function makeRplTaskEntry(t, e) { return (r)=>{ if (!t.dirent.isSymbolicLink()) return void r(null, t); e.fs.stat(t.path, (n, s)=>{ if (null !== n) { if (e.throwErrorOnBrokenSymbolicLink) return void r(n); r(null, t); return; } t.dirent = o.fs.createDirentFromStats(t.name, s); r(null, t); }); }; } function readdir(t, e, r) { e.fs.readdir(t, (i, u)=>{ if (null !== i) return void callFailureCallback(r, i); const c = u.map((r)=>{ const s = a.joinPathSegments(t, r, e.pathSegmentSeparator); return (t)=>{ n.stat(s, e.fsStatSettings, (n, i)=>{ if (null !== n) return void t(n); const a = { name: r, path: s, dirent: o.fs.createDirentFromStats(r, i) }; if (e.stats) a.stats = i; t(null, a); }); }; }); s(c, (t, e)=>{ if (null !== t) return void callFailureCallback(r, t); callSuccessCallback(r, e); }); }); } e.readdir = readdir; function callFailureCallback(t, e) { t(e); } function callSuccessCallback(t, e) { t(null, e); } }, 3253: (t, e)=>{ "use strict"; Object.defineProperty(e, "__esModule", { value: true }); e.joinPathSegments = void 0; function joinPathSegments(t, e, r) { if (t.endsWith(r)) return t + e; return t + r + e; } e.joinPathSegments = joinPathSegments; }, 8907: (t, e, r)=>{ "use strict"; Object.defineProperty(e, "__esModule", { value: true }); e.readdir = e.readdirWithFileTypes = e.read = void 0; const n = r(3645); const s = r(6325); const i = r(946); const o = r(3253); function read(t, e) { if (!e.stats && s.IS_SUPPORT_READDIR_WITH_FILE_TYPES) return readdirWithFileTypes(t, e); return readdir(t, e); } e.read = read; function readdirWithFileTypes(t, e) { const r = e.fs.readdirSync(t, { withFileTypes: true }); return r.map((r)=>{ const n = { dirent: r, name: r.name, path: o.joinPathSegments(t, r.name, e.pathSegmentSeparator) }; if (n.dirent.isSymbolicLink() && e.followSymbolicLinks) try { const t = e.fs.statSync(n.path); n.dirent = i.fs.createDirentFromStats(n.name, t); } catch (t) { if (e.throwErrorOnBrokenSymbolicLink) throw t; } return n; }); } e.readdirWithFileTypes = readdirWithFileTypes; function readdir(t, e) { const r = e.fs.readdirSync(t); return r.map((r)=>{ const s = o.joinPathSegments(t, r, e.pathSegmentSeparator); const a = n.statSync(s, e.fsStatSettings); const u = { name: r, path: s, dirent: i.fs.createDirentFromStats(r, a) }; if (e.stats) u.stats = a; return u; }); } e.readdir = readdir; }, 3486: (t, e, r)=>{ "use strict"; Object.defineProperty(e, "__esModule", { value: true }); const n = r(1017); const s = r(3645); const i = r(6491); class Settings { constructor(t = {}){ this._options = t; this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false); this.fs = i.createFileSystemAdapter(this._options.fs); this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, n.sep); this.stats = this._getValue(this._options.stats, false); this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true); this.fsStatSettings = new s.Settings({ followSymbolicLink: this.followSymbolicLinks, fs: this.fs, throwErrorOnBrokenSymbolicLink: this.throwErrorOnBrokenSymbolicLink }); } _getValue(t, e) { return null != t ? t : e; } } e["default"] = Settings; }, 2926: (t, e)=>{ "use strict"; Object.defineProperty(e, "__esModule", { value: true }); e.createDirentFromStats = void 0; class DirentFromStats { constructor(t, e){ this.name = t; this.isBlockDevice = e.isBlockDevice.bind(e); this.isCharacterDevice = e.isCharacterDevice.bind(e); this.isDirectory = e.isDirectory.bind(e); this.isFIFO = e.isFIFO.bind(e); this.isFile = e.isFile.bind(e); this.isSocket = e.isSocket.bind(e); this.isSymbolicLink = e.isSymbolicLink.bind(e); } } function createDirentFromStats(t, e) { return new DirentFromStats(t, e); } e.createDirentFromStats = createDirentFromStats; }, 946: (t, e, r)=>{ "use strict"; Object.defineProperty(e, "__esModule", { value: true }); e.fs = void 0; const n = r(2926); e.fs = n; }, 2243: (t, e, r)=>{ "use strict"; Object.defineProperty(e, "__esModule", { value: true }); e.createFileSystemAdapter = e.FILE_SYSTEM_ADAPTER = void 0; const n = r(7147); e.FILE_SYSTEM_ADAPTER = { lstat: n.lstat, stat: n.stat, lstatSync: n.lstatSync, statSync: n.statSync }; function createFileSystemAdapter(t) { if (void 0 === t) return e.FILE_SYSTEM_ADAPTER; return Object.assign(Object.assign({}, e.FILE_SYSTEM_ADAPTER), t); } e.createFileSystemAdapter = createFileSystemAdapter; }, 3645: (t, e, r)=>{ "use strict"; Object.defineProperty(e, "__esModule", { value: true }); e.statSync = e.stat = e.Settings = void 0; const n = r(6948); const s = r(6750); const i = r(1917); e.Settings = i.default; function stat(t, e, r) { if ("function" == typeof e) return void n.read(t, getSettings(), e); n.read(t, getSettings(e), r); } e.stat = stat; function statSync(t, e) { const r = getSettings(e); return s.read(t, r); } e.statSync = statSync; function getSettings(t = {}) { if (t instanceof i.default) return t; return new i.default(t); } }, 6948: (t, e)=>{ "use strict"; Object.defineProperty(e, "__esModule", { value: true }); e.read = void 0; function read(t, e, r) { e.fs.lstat(t, (n, s)=>{ if (null !== n) return void callFailureCallback(r, n); if (!s.isSymbolicLink() || !e.followSymbolicLink) return void callSuccessCallback(r, s); e.fs.stat(t, (t, n)=>{ if (null !== t) { if (e.throwErrorOnBrokenSymbolicLink) return void callFailureCallback(r, t); callSuccessCallback(r, s); return; } if (e.markSymbolicLink) n.isSymbolicLink = ()=>true; callSuccessCallback(r, n); }); }); } e.read = read; function callFailureCallback(t, e) { t(e); } function callSuccessCallback(t, e) { t(null, e); } }, 6750: (t, e)=>{ "use strict"; Object.defineProperty(e, "__esModule", { value: true }); e.read = void 0; function read(t, e) { const r = e.fs.lstatSync(t); if (!r.isSymbolicLink() || !e.followSymbolicLink) return r; try { const r = e.fs.statSync(t); if (e.markSymbolicLink) r.isSymbolicLink = ()=>true; return r; } catch (t) { if (!e.throwErrorOnBrokenSymbolicLink) return r; throw t; } } e.read = read; }, 1917: (t, e, r)=>{ "use strict"; Object.defineProperty(e, "__esModule", { value: true }); const n = r(2243); class Settings { constructor(t = {}){ this._options = t; this.followSymbolicLink = this._getValue(this._options.followSymbolicLink, true); this.fs = n.createFileSystemAdapter(this._options.fs); this.markSymbolicLink = this._getValue(this._options.markSymbolicLink, false); this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true); } _getValue(t, e) { return null != t ? t : e; } } e["default"] = Settings; }, 4328: (t, e, r)=>{ "use strict"; Object.defineProperty(e, "__esModule", { value: true }); e.Settings = e.walkStream = e.walkSync = e.walk = void 0; const n = r(4306); const s = r(2686); const i = r(8918); const o = r(8831); e.Settings = o.default; function walk(t, e, r) { if ("function" == typeof e) return void new n.default(t, getSettings()).read(e); new n.default(t, getSettings(e)).read(r); } e.walk = walk; function walkSync(t, e) { const r = getSettings(e); const n = new i.default(t, r); return n.read(); } e.walkSync = walkSync; function walkStream(t, e) { const r = getSettings(e); const n = new s.default(t, r); return n.read(); } e.walkStream = walkStream; function getSettings(t = {}) { if (t instanceof o.default) return t; return new o.default(t); } }, 4306: (t, e, r)=>{ "use strict"; Object.defineProperty(e, "__esModule", { value: true }); const n = r(1293); class AsyncProvider { constructor(t, e){ this._root = t; this._settings = e; this._reader = new n.default(this._root, this._settings); this._storage = []; } read(t) { this._reader.onError((e)=>{ callFailureCallback(t, e); }); this._reader.onEntry((t)=>{ this._storage.push(t); }); this._reader.onEnd(()=>{ callSuccessCallback(t, this._storage); }); this._reader.read(); } } e["default"] = AsyncProvider; function callFailureCallback(t, e) { t(e); } function callSuccessCallback(t, e) { t(null, e); } }, 2686: (t, e, r)=>{ "use strict"; Object.defineProperty(e, "__esModule", { value: true }); const n = r(2781); const s = r(1293); class StreamProvider { constructor(t, e){ this._root = t; this._settings = e; this._reader = new s.default(this._root, this._settings); this._stream = new n.Readable({ objectMode: true, read: ()=>{}, destroy: ()=>{ if (!this._reader.isDestroyed) this._reader.destroy(); } }); } read() { this._reader.onError((t)=>{ this._stream.emit("error", t); }); this._reader.onEntry((t)=>{ this._stream.push(t); }); this._reader.onEnd(()=>{ this._stream.push(null); }); this._reader.read(); return this._stream; } } e["default"] = StreamProvider; }, 8918: (t, e, r)=>{ "use strict"; Object.defineProperty(e, "__esModule", { value: true }); const n = r(9476); class SyncProvider { constructor(t, e){ this._root = t; this._settings = e; this._reader = new n.default(this._root, this._settings); } read() { return this._reader.read(); } } e["default"] = SyncProvider; }, 1293: (t, e, r)=>{ "use strict"; Object.defineProperty(e, "__esModule", { value: true }); const n = r(2361); const s = r(1659); const i = r(4241); const o = r(1652); const a = r(8376); class AsyncReader extends a.default { constructor(t, e){ super(t, e); this._settings = e; this._scandir = s.scandir; this._emitter = new n.EventEmitter; this._queue = i(this._worker.bind(this), this._settings.concurrency); this._isFatalError = false; this._isDestroyed = false; this._queue.drain = ()=>{ if (!this._isFatalError) this._emitter.emit("end"); }; } read() { this._isFatalError = false; this._isDestroyed = false; setImmediate(()=>{ this._pushToQueue(this._root, this._settings.basePath); }); return this._emitter; } get isDestroyed() { return this._isDestroyed; } destroy() { if (this._isDestroyed) throw new Error("The reader is already destroyed"); this._isDestroyed = true; this._queue.killAndDrain(); } onEntry(t) { this._emitter.on("entry", t); } onError(t) { this._emitter.once("error", t); } onEnd(t) { this._emitter.once("end", t); } _pushToQueue(t, e) { const r = { directory: t, base: e }; this._queue.push(r, (t)=>{ if (null !== t) this._handleError(t); }); } _worker(t, e) { this._scandir(t.directory, this._settings.fsScandirSettings, (r, n)=>{ if (null !== r) return void e(r, void 0); for (const e of n)this._handleEntry(e, t.base); e(null, void 0); }); } _handleError(t) { if (this._isDestroyed || !o.isFatalError(this._settings, t)) return; this._isFatalError = true; this._isDestroyed = true; this._emitter.emit("error", t); } _handleEntry(t, e) { if (this._isDestroyed || this._isFatalError) return; const r = t.path; if (void 0 !== e) t.path = o.joinPathSegments(e, t.name, this._settings.pathSegmentSeparator); if (o.isAppliedFilter(this._settings.entryFilter, t)) this._emitEntry(t); if (t.dirent.isDirectory() && o.isAppliedFilter(this._settings.deepFilter, t)) this._pushToQueue(r, void 0 === e ? void 0 : t.path); } _emitEntry(t) { this._emitter.emit("entry", t); } } e["default"] = AsyncReader; }, 1652: (t, e)=>{ "use strict"; Object.defineProperty(e, "__esModule", { value: true }); e.joinPathSegments = e.replacePathSegmentSeparator = e.isAppliedFilter = e.isFatalError = void 0; function isFatalError(t, e) { if (null === t.errorFilter) return true; return !t.errorFilter(e); } e.isFatalError = isFatalError; function isAppliedFilter(t, e) { return null === t || t(e); } e.isAppliedFilter = isAppliedFilter; function replacePathSegmentSeparator(t, e) { return t.split(/[/\\]/).join(e); } e.replacePathSegmentSeparator = replacePathSegmentSeparator; function joinPathSegments(t, e, r) { if ("" === t) return e; if (t.endsWith(r)) return t + e; return t + r + e; } e.joinPathSegments = joinPathSegments; }, 8376: (t, e, r)=>{ "use strict"; Object.defineProperty(e, "__esModule", { value: true }); const n = r(1652); class Reader { constructor(t, e){ this._root = t; this._settings = e; this._root = n.replacePathSegmentSeparator(t, e.pathSegmentSeparator); } } e["default"] = Reader; }, 9476: (t, e, r)=>{ "use strict"; Object.defineProperty(e, "__esModule", { value: true }); const n = r(1659); const s = r(1652); const i = r(8376); class SyncReader extends i.default { constructor(){ super(...arguments); this._scandir = n.scandirSync; this._storage = []; this._queue = new Set; } read() { this._pushToQueue(this._root, this._settings.basePath); this._handleQueue(); return this._storage; } _pushToQueue(t, e) { this._queue.add({ directory: t, base: e }); } _handleQueue() { for (const t of this._queue.values())this._handleDirectory(t.directory, t.base); } _handleDirectory(t, e) { try { const r = this._scandir(t, this._settings.fsScandirSettings); for (const t of r)this._handleEntry(t, e); } catch (t) { this._handleError(t); } } _handleError(t) { if (!s.isFatalError(this._settings, t)) return; throw t; } _handleEntry(t, e) { const r = t.path; if (void 0 !== e) t.path = s.joinPathSegments(e, t.name, this._settings.pathSegmentSeparator); if (s.isAppliedFilter(this._settings.entryFilter, t)) this._pushToStorage(t); if (t.dirent.isDirectory() && s.isAppliedFilter(this._settings.deepFilter, t)) this._pushToQueue(r, void 0 === e ? void 0 : t.path); } _pushToStorage(t) { this._storage.push(t); } } e["default"] = SyncReader; }, 8831: (t, e, r)=>{ "use strict"; Object.defineProperty(e, "__esModule", { value: true }); const n = r(1017); const s = r(1659); class Settings { constructor(t = {}){ this._options = t; this.basePath = this._getValue(this._options.basePath, void 0); this.concurrency = this._getValue(this._options.concurrency, 1 / 0); this.deepFilter = this._getValue(this._options.deepFilter, null); this.entryFilter = this._getValue(this._options.entryFilter, null); this.errorFilter = this._getValue(this._options.errorFilter, null); this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, n.sep); this.fsScandirSettings = new s.Settings({ followSymbolicLinks: this._options.followSymbolicLinks, fs: this._options.fs, pathSegmentSeparator: this._options.pathSegmentSeparator, stats: this._options.stats, throwErrorOnBrokenSymbolicLink: this._options.throwErrorOnBrokenSymbolicLink }); } _getValue(t, e) { return null != t ? t : e; } } e["default"] = Settings; }, 1570: (t, e, r)=>{ "use strict"; const n = r(3625); const s = r(4666); const i = r(6183); const o = r(2467); const braces = (t, e = {})=>{ let r = []; if (Array.isArray(t)) for (let n of t){ let t = braces.create(n, e); if (Array.isArray(t)) r.push(...t); else r.push(t); } else r = [].concat(braces.create(t, e)); if (e && true === e.expand && true === e.nodupes) r = [ ...new Set(r) ]; return r; }; braces.parse = (t, e = {})=>o(t, e); braces.stringify = (t, e = {})=>{ if ("string" == typeof t) return n(braces.parse(t, e), e); return n(t, e); }; braces.compile = (t, e = {})=>{ if ("string" == typeof t) t = braces.parse(t, e); return s(t, e); }; braces.expand = (t, e = {})=>{ if ("string" == typeof t) t = braces.parse(t, e); let r = i(t, e); if (true === e.noempty) r = r.filter(Boolean); if (true === e.nodupes) r = [ ...new Set(r) ]; return r; }; braces.create = (t, e = {})=>{ if ("" === t || t.length < 3) return [ t ]; return true !== e.expand ? braces.compile(t, e) : braces.expand(t, e); }; t.exports = braces; }, 4666: (t, e, r)=>{ "use strict"; const n = r(442); const s = r(2456); const compile = (t, e = {})=>{ let walk = (t, r = {})=>{ let i = s.isInvalidBrace(r); let o = true === t.invalid && true === e.escapeInvalid; let a = true === i || true === o; let u = true === e.escapeInvalid ? "\\" : ""; let c = ""; if (true === t.isOpen) return u + t.value; if (true === t.isClose) return u + t.value; if ("open" === t.type) return a ? u + t.value : "("; if ("close" === t.type) return a ? u + t.value : ")"; if ("comma" === t.type) return "comma" === t.prev.type ? "" : a ? t.value : "|"; if (t.value) return t.value; if (t.nodes && t.ranges > 0) { let r = s.reduce(t.nodes); let i = n(...r, { ...e, wrap: false, toRegex: true }); if (0 !== i.length) return r.length > 1 && i.length > 1 ? `(${i})` : i; } if (t.nodes) for (let e of t.nodes)c += walk(e, t); return c; }; return walk(t); }; t.exports = compile; }, 487: (t)=>{ "use strict"; t.exports = { MAX_LENGTH: 65536, CHAR_0: "0", CHAR_9: "9", CHAR_UPPERCASE_A: "A", CHAR_LOWERCASE_A: "a", CHAR_UPPERCASE_Z: "Z", CHAR_LOWERCASE_Z: "z", CHAR_LEFT_PARENTHESES: "(", CHAR_RIGHT_PARENTHESES: ")", CHAR_ASTERISK: "*", CHAR_AMPERSAND: "&", CHAR_AT: "@", CHAR_BACKSLASH: "\\", CHAR_BACKTICK: "`", CHAR_CARRIAGE_RETURN: "\r", CHAR_CIRCUMFLEX_ACCENT: "^", CHAR_COLON: ":", CHAR_COMMA: ",", CHAR_DOLLAR: "$", CHAR_DOT: ".", CHAR_DOUBLE_QUOTE: '"', CHAR_EQUAL: "=", CHAR_EXCLAMATION_MARK: "!", CHAR_FORM_FEED: "\f", CHAR_FORWARD_SLASH: "/", CHAR_HASH: "#", CHAR_HYPHEN_MINUS: "-", CHAR_LEFT_ANGLE_BRACKET: "<", CHAR_LEFT_CURLY_BRACE: "{", CHAR_LEFT_SQUARE_BRACKET: "[", CHAR_LINE_FEED: "\n", CHAR_NO_BREAK_SPACE: " ", CHAR_PERCENT: "%", CHAR_PLUS: "+", CHAR_QUESTION_MARK: "?", CHAR_RIGHT_ANGLE_BRACKET: ">", CHAR_RIGHT_CURLY_BRACE: "}", CHAR_RIGHT_SQUARE_BRACKET: "]", CHAR_SEMICOLON: ";", CHAR_SINGLE_QUOTE: "'", CHAR_SPACE: " ", CHAR_TAB: "\t", CHAR_UNDERSCORE: "_", CHAR_VERTICAL_LINE: "|", CHAR_ZERO_WIDTH_NOBREAK_SPACE: "\ufeff" }; }, 6183: (t, e, r)=>{ "use strict"; const n = r(442); const s = r(3625); const i = r(2456); const append = (t = "", e = "", r = false)=>{ let n = []; t = [].concat(t); e = [].concat(e); if (!e.length) return t; if (!t.length) return r ? i.flatten(e).map((t)=>`{${t}}`) : e; for (let s of t)if (Array.isArray(s)) for (let t of s)n.push(append(t, e, r)); else for (let t of e){ if (true === r && "string" == typeof t) t = `{${t}}`; n.push(Array.isArray(t) ? append(s, t, r) : s + t); } return i.flatten(n); }; const expand = (t, e = {})=>{ let r = void 0 === e.rangeLimit ? 1e3 : e.rangeLimit; let walk = (t, o = {})=>{ t.queue = []; let a = o; let u = o.queue; while("brace" !== a.type && "root" !== a.type && a.parent){ a = a.parent; u = a.queue; } if (t.invalid || t.dollar) return void u.push(append(u.pop(), s(t, e))); if ("brace" === t.type && true !== t.invalid && 2 === t.nodes.length) return void u.push(append(u.pop(), [ "{}" ])); if (t.nodes && t.ranges > 0) { let o = i.reduce(t.nodes); if (i.exceedsLimit(...o, e.step, r)) throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit."); let a = n(...o, e); if (0 === a.length) a = s(t, e); u.push(append(u.pop(), a)); t.nodes = []; return; } let c = i.encloseBrace(t); let l = t.queue; let f = t; while("brace" !== f.type && "root" !== f.type && f.parent){ f = f.parent; l = f.queue; } for(let e = 0; e < t.nodes.length; e++){ let r = t.nodes[e]; if ("comma" === r.type && "brace" === t.type) { if (1 === e) l.push(""); l.push(""); continue; } if ("close" === r.type) { u.push(append(u.pop(), l, c)); continue; } if (r.value && "open" !== r.type) { l.push(append(l.pop(), r.value)); continue; } if (r.nodes) walk(r, t); } return l; }; return i.flatten(walk(t)); }; t.exports = expand; }, 2467: (t, e, r)=>{ "use strict"; const n = r(3625); const { MAX_LENGTH: s, CHAR_BACKSLASH: i, CHAR_BACKTICK: o, CHAR_COMMA: a, CHAR_DOT: u, CHAR_LEFT_PARENTHESES: c, CHAR_RIGHT_PARENTHESES: l, CHAR_LEFT_CURLY_BRACE: f, CHAR_RIGHT_CURLY_BRACE: p, CHAR_LEFT_SQUARE_BRACKET: h, CHAR_RIGHT_SQUARE_BRACKET: d, CHAR_DOUBLE_QUOTE: _, CHAR_SINGLE_QUOTE: g, CHAR_NO_BREAK_SPACE: y, CHAR_ZERO_WIDTH_NOBREAK_SPACE: S } = r(487); const parse = (t, e = {})=>{ if ("string" != typeof t) throw new TypeError("Expected a string"); let r = e || {}; let m = "number" == typeof r.maxLength ? Math.min(s, r.maxLength) : s; if (t.length > m) throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${m})`); let v = { type: "root", input: t, nodes: [] }; let E = [ v ]; let A = v; let b = v; let R = 0; let P = t.length; let x = 0; let k = 0; let T; const advance = ()=>t[x++]; const push = (t)=>{ if ("text" === t.type && "dot" === b.type) b.type = "text"; if (b && "text" === b.type && "text" === t.type) { b.value += t.value; return; } A.nodes.push(t); t.parent = A; t.prev = b; b = t; return t; }; push({ type: "bos" }); while(x < P){ A = E[E.length - 1]; T = advance(); if (T === S || T === y) continue; if (T === i) { push({ type: "text", value: (e.keepEscaping ? T : "") + advance() }); continue; } if (T === d) { push({ type: "text", value: "\\" + T }); continue; } if (T === h) { R++; let e; while(x < P && (e = advance())){ T += e; if (e === h) { R++; continue; } if (e === i) { T += advance(); continue; } if (e === d) { R--; if (0 === R) break; } } push({ type: "text", value: T }); continue; } if (T === c) { A = push({ type: "paren", nodes: [] }); E.push(A); push({ type: "text", value: T }); continue; } if (T === l) { if ("paren" !== A.type) { push({ type: "text", value: T }); continue; } A = E.pop(); push({ type: "text", value: T }); A = E[E.length - 1]; continue; } if (T === _ || T === g || T === o) { let t = T; let r; if (true !== e.keepQuotes) T = ""; while(x < P && (r = advance())){ if (r === i) { T += r + advance(); continue; } if (r === t) { if (true === e.keepQuotes) T += r; break; } T += r; } push({ type: "text", value: T }); continue; } if (T === f) { k++; let t = b.value && "$" === b.value.slice(-1) || true === A.dollar; let e = { type: "brace", open: true, close: false, dollar: t, depth: k, commas: 0, ranges: 0, nodes: [] }; A = push(e); E.push(A); push({ type: "open", value: T }); continue; } if (T === p) { if ("brace" !== A.type) { push({ type: "text", value: T }); continue; } let t = "close"; A = E.pop(); A.close = true; push({ type: t, value: T }); k--; A = E[E.length - 1]; continue; } if (T === a && k > 0) { if (A.ranges > 0) { A.ranges = 0; let t = A.nodes.shift(); A.nodes = [ t, { type: "text", value: n(A) } ]; } push({ type: "comma", value: T }); A.commas++; continue; } if (T === u && k > 0 && 0 === A.commas) { let t = A.nodes; if (0 === k || 0 === t.length) { push({ type: "text", value: T }); continue; } if ("dot" === b.type) { A.range = []; b.value += T; b.type = "range"; if (3 !== A.nodes.length && 5 !== A.nodes.length) { A.invalid = true; A.ranges = 0; b.type = "text"; continue; } A.ranges++; A.args = []; continue; } if ("range" === b.type) { t.pop(); let e = t[t.length - 1]; e.value += b.value + T; b = e; A.ranges--; continue; } push({ type: "dot", value: T }); continue; } push({ type: "text", value: T }); } do { A = E.pop(); if ("root" !== A.type) { A.nodes.forEach((t)=>{ if (!t.nodes) { if ("open" === t.type) t.isOpen = true; if ("close" === t.type) t.isClose = true; if (!t.nodes) t.type = "text"; t.invalid = true; } }); let t = E[E.length - 1]; let e = t.nodes.indexOf(A); t.nodes.splice(e, 1, ...A.nodes); } }while (E.length > 0); push({ type: "eos" }); return v; }; t.exports = parse; }, 3625: (t, e, r)=>{ "use strict"; const n = r(2456); t.exports = (t, e = {})=>{ let stringify = (t, r = {})=>{ let s = e.escapeInvalid && n.isInvalidBrace(r); let i = true === t.invalid && true === e.escapeInvalid; let o = ""; if (t.value) { if ((s || i) && n.isOpenOrClose(t)) return "\\" + t.value; return t.value; } if (t.value) return t.value; if (t.nodes) for (let e of t.nodes)o += stringify(e); return o; }; return stringify(t); }; }, 2456: (t, e)=>{ "use strict"; e.isInteger = (t)=>{ if ("number" == typeof t) return Number.isInteger(t); if ("string" == typeof t && "" !== t.trim()) return Number.isInteger(Number(t)); return false; }; e.find = (t, e)=>t.nodes.find((t)=>t.type === e); e.exceedsLimit = (t, r, n = 1, s)=>{ if (false === s) return false; if (!e.isInteger(t) || !e.isInteger(r)) return false; return (Number(r) - Number(t)) / Number(n) >= s; }; e.escapeNode = (t, e = 0, r)=>{ let n = t.nodes[e]; if (!n) return; if (r && n.type === r || "open" === n.type || "close" === n.type) { if (true !== n.escaped) { n.value = "\\" + n.value; n.escaped = true; } } }; e.encloseBrace = (t)=>{ if ("brace" !== t.type) return false; if (t.commas >> 0 + t.ranges === 0) { t.invalid = true; return true; } return false; }; e.isInvalidBrace = (t)=>{ if ("brace" !== t.type) return false; if (true === t.invalid || t.dollar) return true; if (t.commas >> 0 + t.ranges === 0) { t.invalid = true; return true; } if (true !== t.open || true !== t.close) { t.invalid = true; return true; } return false; }; e.isOpenOrClose = (t)=>{ if ("open" === t.type || "close" === t.type) return true; return true === t.open || true === t.close; }; e.reduce = (t)=>t.reduce((t, e)=>{ if ("text" === e.type) t.push(e.value); if ("range" === e.type) e.type = "text"; return t; }, []); e.flatten = (...t)=>{ const e = []; const flat = (t)=>{ for(let r = 0; r < t.length; r++){ let n = t[r]; Array.isArray(n) ? flat(n) : void 0 !== n && e.push(n); } return e; }; flat(t); return e; }; }, 3924: (t, e, r)=>{ "use strict"; const n = r(2291); const s = r(8620); const i = r(7900); const o = r(5407); const a = r(1066); const u = r(7190); const c = r(3828); async function FastGlob(t, e) { assertPatternsInput(t); co