prebundle
Version:
1,443 lines • 200 kB
JavaScript
(() => {
var __webpack_modules__ = {
3250: (__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0;
const fs = __nccwpck_require__(9896);
exports.FILE_SYSTEM_ADAPTER = {
lstat: fs.lstat,
stat: fs.stat,
lstatSync: fs.lstatSync,
statSync: fs.statSync,
readdir: fs.readdir,
readdirSync: fs.readdirSync,
};
function createFileSystemAdapter(fsMethods) {
if (fsMethods === undefined) {
return exports.FILE_SYSTEM_ADAPTER;
}
return Object.assign(
Object.assign({}, exports.FILE_SYSTEM_ADAPTER),
fsMethods,
);
}
exports.createFileSystemAdapter = createFileSystemAdapter;
},
4541: (__unused_webpack_module, exports) => {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = void 0;
const NODE_PROCESS_VERSION_PARTS = process.versions.node.split(".");
if (
NODE_PROCESS_VERSION_PARTS[0] === undefined ||
NODE_PROCESS_VERSION_PARTS[1] === undefined
) {
throw new Error(
`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`,
);
}
const MAJOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[0], 10);
const MINOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[1], 10);
const SUPPORTED_MAJOR_VERSION = 10;
const SUPPORTED_MINOR_VERSION = 10;
const IS_MATCHED_BY_MAJOR = MAJOR_VERSION > SUPPORTED_MAJOR_VERSION;
const IS_MATCHED_BY_MAJOR_AND_MINOR =
MAJOR_VERSION === SUPPORTED_MAJOR_VERSION &&
MINOR_VERSION >= SUPPORTED_MINOR_VERSION;
exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES =
IS_MATCHED_BY_MAJOR || IS_MATCHED_BY_MAJOR_AND_MINOR;
},
9096: (__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Settings = exports.scandirSync = exports.scandir = void 0;
const async = __nccwpck_require__(9389);
const sync = __nccwpck_require__(2574);
const settings_1 = __nccwpck_require__(2695);
exports.Settings = settings_1.default;
function scandir(path, optionsOrSettingsOrCallback, callback) {
if (typeof optionsOrSettingsOrCallback === "function") {
async.read(path, getSettings(), optionsOrSettingsOrCallback);
return;
}
async.read(path, getSettings(optionsOrSettingsOrCallback), callback);
}
exports.scandir = scandir;
function scandirSync(path, optionsOrSettings) {
const settings = getSettings(optionsOrSettings);
return sync.read(path, settings);
}
exports.scandirSync = scandirSync;
function getSettings(settingsOrOptions = {}) {
if (settingsOrOptions instanceof settings_1.default) {
return settingsOrOptions;
}
return new settings_1.default(settingsOrOptions);
}
},
9389: (__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.readdir = exports.readdirWithFileTypes = exports.read = void 0;
const fsStat = __nccwpck_require__(1113);
const rpl = __nccwpck_require__(7710);
const constants_1 = __nccwpck_require__(4541);
const utils = __nccwpck_require__(5418);
const common = __nccwpck_require__(7404);
function read(directory, settings, callback) {
if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
readdirWithFileTypes(directory, settings, callback);
return;
}
readdir(directory, settings, callback);
}
exports.read = read;
function readdirWithFileTypes(directory, settings, callback) {
settings.fs.readdir(
directory,
{ withFileTypes: true },
(readdirError, dirents) => {
if (readdirError !== null) {
callFailureCallback(callback, readdirError);
return;
}
const entries = dirents.map((dirent) => ({
dirent,
name: dirent.name,
path: common.joinPathSegments(
directory,
dirent.name,
settings.pathSegmentSeparator,
),
}));
if (!settings.followSymbolicLinks) {
callSuccessCallback(callback, entries);
return;
}
const tasks = entries.map((entry) =>
makeRplTaskEntry(entry, settings),
);
rpl(tasks, (rplError, rplEntries) => {
if (rplError !== null) {
callFailureCallback(callback, rplError);
return;
}
callSuccessCallback(callback, rplEntries);
});
},
);
}
exports.readdirWithFileTypes = readdirWithFileTypes;
function makeRplTaskEntry(entry, settings) {
return (done) => {
if (!entry.dirent.isSymbolicLink()) {
done(null, entry);
return;
}
settings.fs.stat(entry.path, (statError, stats) => {
if (statError !== null) {
if (settings.throwErrorOnBrokenSymbolicLink) {
done(statError);
return;
}
done(null, entry);
return;
}
entry.dirent = utils.fs.createDirentFromStats(entry.name, stats);
done(null, entry);
});
};
}
function readdir(directory, settings, callback) {
settings.fs.readdir(directory, (readdirError, names) => {
if (readdirError !== null) {
callFailureCallback(callback, readdirError);
return;
}
const tasks = names.map((name) => {
const path = common.joinPathSegments(
directory,
name,
settings.pathSegmentSeparator,
);
return (done) => {
fsStat.stat(path, settings.fsStatSettings, (error, stats) => {
if (error !== null) {
done(error);
return;
}
const entry = {
name,
path,
dirent: utils.fs.createDirentFromStats(name, stats),
};
if (settings.stats) {
entry.stats = stats;
}
done(null, entry);
});
};
});
rpl(tasks, (rplError, entries) => {
if (rplError !== null) {
callFailureCallback(callback, rplError);
return;
}
callSuccessCallback(callback, entries);
});
});
}
exports.readdir = readdir;
function callFailureCallback(callback, error) {
callback(error);
}
function callSuccessCallback(callback, result) {
callback(null, result);
}
},
7404: (__unused_webpack_module, exports) => {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.joinPathSegments = void 0;
function joinPathSegments(a, b, separator) {
if (a.endsWith(separator)) {
return a + b;
}
return a + separator + b;
}
exports.joinPathSegments = joinPathSegments;
},
2574: (__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.readdir = exports.readdirWithFileTypes = exports.read = void 0;
const fsStat = __nccwpck_require__(1113);
const constants_1 = __nccwpck_require__(4541);
const utils = __nccwpck_require__(5418);
const common = __nccwpck_require__(7404);
function read(directory, settings) {
if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
return readdirWithFileTypes(directory, settings);
}
return readdir(directory, settings);
}
exports.read = read;
function readdirWithFileTypes(directory, settings) {
const dirents = settings.fs.readdirSync(directory, {
withFileTypes: true,
});
return dirents.map((dirent) => {
const entry = {
dirent,
name: dirent.name,
path: common.joinPathSegments(
directory,
dirent.name,
settings.pathSegmentSeparator,
),
};
if (entry.dirent.isSymbolicLink() && settings.followSymbolicLinks) {
try {
const stats = settings.fs.statSync(entry.path);
entry.dirent = utils.fs.createDirentFromStats(entry.name, stats);
} catch (error) {
if (settings.throwErrorOnBrokenSymbolicLink) {
throw error;
}
}
}
return entry;
});
}
exports.readdirWithFileTypes = readdirWithFileTypes;
function readdir(directory, settings) {
const names = settings.fs.readdirSync(directory);
return names.map((name) => {
const entryPath = common.joinPathSegments(
directory,
name,
settings.pathSegmentSeparator,
);
const stats = fsStat.statSync(entryPath, settings.fsStatSettings);
const entry = {
name,
path: entryPath,
dirent: utils.fs.createDirentFromStats(name, stats),
};
if (settings.stats) {
entry.stats = stats;
}
return entry;
});
}
exports.readdir = readdir;
},
2695: (__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const path = __nccwpck_require__(6928);
const fsStat = __nccwpck_require__(1113);
const fs = __nccwpck_require__(3250);
class Settings {
constructor(_options = {}) {
this._options = _options;
this.followSymbolicLinks = this._getValue(
this._options.followSymbolicLinks,
false,
);
this.fs = fs.createFileSystemAdapter(this._options.fs);
this.pathSegmentSeparator = this._getValue(
this._options.pathSegmentSeparator,
path.sep,
);
this.stats = this._getValue(this._options.stats, false);
this.throwErrorOnBrokenSymbolicLink = this._getValue(
this._options.throwErrorOnBrokenSymbolicLink,
true,
);
this.fsStatSettings = new fsStat.Settings({
followSymbolicLink: this.followSymbolicLinks,
fs: this.fs,
throwErrorOnBrokenSymbolicLink: this.throwErrorOnBrokenSymbolicLink,
});
}
_getValue(option, value) {
return option !== null && option !== void 0 ? option : value;
}
}
exports["default"] = Settings;
},
9531: (__unused_webpack_module, exports) => {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createDirentFromStats = void 0;
class DirentFromStats {
constructor(name, stats) {
this.name = name;
this.isBlockDevice = stats.isBlockDevice.bind(stats);
this.isCharacterDevice = stats.isCharacterDevice.bind(stats);
this.isDirectory = stats.isDirectory.bind(stats);
this.isFIFO = stats.isFIFO.bind(stats);
this.isFile = stats.isFile.bind(stats);
this.isSocket = stats.isSocket.bind(stats);
this.isSymbolicLink = stats.isSymbolicLink.bind(stats);
}
}
function createDirentFromStats(name, stats) {
return new DirentFromStats(name, stats);
}
exports.createDirentFromStats = createDirentFromStats;
},
5418: (__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.fs = void 0;
const fs = __nccwpck_require__(9531);
exports.fs = fs;
},
4491: (__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0;
const fs = __nccwpck_require__(9896);
exports.FILE_SYSTEM_ADAPTER = {
lstat: fs.lstat,
stat: fs.stat,
lstatSync: fs.lstatSync,
statSync: fs.statSync,
};
function createFileSystemAdapter(fsMethods) {
if (fsMethods === undefined) {
return exports.FILE_SYSTEM_ADAPTER;
}
return Object.assign(
Object.assign({}, exports.FILE_SYSTEM_ADAPTER),
fsMethods,
);
}
exports.createFileSystemAdapter = createFileSystemAdapter;
},
1113: (__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.statSync = exports.stat = exports.Settings = void 0;
const async = __nccwpck_require__(224);
const sync = __nccwpck_require__(6385);
const settings_1 = __nccwpck_require__(52);
exports.Settings = settings_1.default;
function stat(path, optionsOrSettingsOrCallback, callback) {
if (typeof optionsOrSettingsOrCallback === "function") {
async.read(path, getSettings(), optionsOrSettingsOrCallback);
return;
}
async.read(path, getSettings(optionsOrSettingsOrCallback), callback);
}
exports.stat = stat;
function statSync(path, optionsOrSettings) {
const settings = getSettings(optionsOrSettings);
return sync.read(path, settings);
}
exports.statSync = statSync;
function getSettings(settingsOrOptions = {}) {
if (settingsOrOptions instanceof settings_1.default) {
return settingsOrOptions;
}
return new settings_1.default(settingsOrOptions);
}
},
224: (__unused_webpack_module, exports) => {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.read = void 0;
function read(path, settings, callback) {
settings.fs.lstat(path, (lstatError, lstat) => {
if (lstatError !== null) {
callFailureCallback(callback, lstatError);
return;
}
if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
callSuccessCallback(callback, lstat);
return;
}
settings.fs.stat(path, (statError, stat) => {
if (statError !== null) {
if (settings.throwErrorOnBrokenSymbolicLink) {
callFailureCallback(callback, statError);
return;
}
callSuccessCallback(callback, lstat);
return;
}
if (settings.markSymbolicLink) {
stat.isSymbolicLink = () => true;
}
callSuccessCallback(callback, stat);
});
});
}
exports.read = read;
function callFailureCallback(callback, error) {
callback(error);
}
function callSuccessCallback(callback, result) {
callback(null, result);
}
},
6385: (__unused_webpack_module, exports) => {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.read = void 0;
function read(path, settings) {
const lstat = settings.fs.lstatSync(path);
if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
return lstat;
}
try {
const stat = settings.fs.statSync(path);
if (settings.markSymbolicLink) {
stat.isSymbolicLink = () => true;
}
return stat;
} catch (error) {
if (!settings.throwErrorOnBrokenSymbolicLink) {
return lstat;
}
throw error;
}
}
exports.read = read;
},
52: (__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const fs = __nccwpck_require__(4491);
class Settings {
constructor(_options = {}) {
this._options = _options;
this.followSymbolicLink = this._getValue(
this._options.followSymbolicLink,
true,
);
this.fs = fs.createFileSystemAdapter(this._options.fs);
this.markSymbolicLink = this._getValue(
this._options.markSymbolicLink,
false,
);
this.throwErrorOnBrokenSymbolicLink = this._getValue(
this._options.throwErrorOnBrokenSymbolicLink,
true,
);
}
_getValue(option, value) {
return option !== null && option !== void 0 ? option : value;
}
}
exports["default"] = Settings;
},
7669: (__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Settings =
exports.walkStream =
exports.walkSync =
exports.walk =
void 0;
const async_1 = __nccwpck_require__(228);
const stream_1 = __nccwpck_require__(1254);
const sync_1 = __nccwpck_require__(7885);
const settings_1 = __nccwpck_require__(328);
exports.Settings = settings_1.default;
function walk(directory, optionsOrSettingsOrCallback, callback) {
if (typeof optionsOrSettingsOrCallback === "function") {
new async_1.default(directory, getSettings()).read(
optionsOrSettingsOrCallback,
);
return;
}
new async_1.default(
directory,
getSettings(optionsOrSettingsOrCallback),
).read(callback);
}
exports.walk = walk;
function walkSync(directory, optionsOrSettings) {
const settings = getSettings(optionsOrSettings);
const provider = new sync_1.default(directory, settings);
return provider.read();
}
exports.walkSync = walkSync;
function walkStream(directory, optionsOrSettings) {
const settings = getSettings(optionsOrSettings);
const provider = new stream_1.default(directory, settings);
return provider.read();
}
exports.walkStream = walkStream;
function getSettings(settingsOrOptions = {}) {
if (settingsOrOptions instanceof settings_1.default) {
return settingsOrOptions;
}
return new settings_1.default(settingsOrOptions);
}
},
228: (__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const async_1 = __nccwpck_require__(750);
class AsyncProvider {
constructor(_root, _settings) {
this._root = _root;
this._settings = _settings;
this._reader = new async_1.default(this._root, this._settings);
this._storage = [];
}
read(callback) {
this._reader.onError((error) => {
callFailureCallback(callback, error);
});
this._reader.onEntry((entry) => {
this._storage.push(entry);
});
this._reader.onEnd(() => {
callSuccessCallback(callback, this._storage);
});
this._reader.read();
}
}
exports["default"] = AsyncProvider;
function callFailureCallback(callback, error) {
callback(error);
}
function callSuccessCallback(callback, entries) {
callback(null, entries);
}
},
1254: (__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const stream_1 = __nccwpck_require__(2203);
const async_1 = __nccwpck_require__(750);
class StreamProvider {
constructor(_root, _settings) {
this._root = _root;
this._settings = _settings;
this._reader = new async_1.default(this._root, this._settings);
this._stream = new stream_1.Readable({
objectMode: true,
read: () => {},
destroy: () => {
if (!this._reader.isDestroyed) {
this._reader.destroy();
}
},
});
}
read() {
this._reader.onError((error) => {
this._stream.emit("error", error);
});
this._reader.onEntry((entry) => {
this._stream.push(entry);
});
this._reader.onEnd(() => {
this._stream.push(null);
});
this._reader.read();
return this._stream;
}
}
exports["default"] = StreamProvider;
},
7885: (__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const sync_1 = __nccwpck_require__(5835);
class SyncProvider {
constructor(_root, _settings) {
this._root = _root;
this._settings = _settings;
this._reader = new sync_1.default(this._root, this._settings);
}
read() {
return this._reader.read();
}
}
exports["default"] = SyncProvider;
},
750: (__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const events_1 = __nccwpck_require__(4434);
const fsScandir = __nccwpck_require__(9096);
const fastq = __nccwpck_require__(4208);
const common = __nccwpck_require__(3285);
const reader_1 = __nccwpck_require__(3747);
class AsyncReader extends reader_1.default {
constructor(_root, _settings) {
super(_root, _settings);
this._settings = _settings;
this._scandir = fsScandir.scandir;
this._emitter = new events_1.EventEmitter();
this._queue = fastq(
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(callback) {
this._emitter.on("entry", callback);
}
onError(callback) {
this._emitter.once("error", callback);
}
onEnd(callback) {
this._emitter.once("end", callback);
}
_pushToQueue(directory, base) {
const queueItem = { directory, base };
this._queue.push(queueItem, (error) => {
if (error !== null) {
this._handleError(error);
}
});
}
_worker(item, done) {
this._scandir(
item.directory,
this._settings.fsScandirSettings,
(error, entries) => {
if (error !== null) {
done(error, undefined);
return;
}
for (const entry of entries) {
this._handleEntry(entry, item.base);
}
done(null, undefined);
},
);
}
_handleError(error) {
if (
this._isDestroyed ||
!common.isFatalError(this._settings, error)
) {
return;
}
this._isFatalError = true;
this._isDestroyed = true;
this._emitter.emit("error", error);
}
_handleEntry(entry, base) {
if (this._isDestroyed || this._isFatalError) {
return;
}
const fullpath = entry.path;
if (base !== undefined) {
entry.path = common.joinPathSegments(
base,
entry.name,
this._settings.pathSegmentSeparator,
);
}
if (common.isAppliedFilter(this._settings.entryFilter, entry)) {
this._emitEntry(entry);
}
if (
entry.dirent.isDirectory() &&
common.isAppliedFilter(this._settings.deepFilter, entry)
) {
this._pushToQueue(
fullpath,
base === undefined ? undefined : entry.path,
);
}
}
_emitEntry(entry) {
this._emitter.emit("entry", entry);
}
}
exports["default"] = AsyncReader;
},
3285: (__unused_webpack_module, exports) => {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.joinPathSegments =
exports.replacePathSegmentSeparator =
exports.isAppliedFilter =
exports.isFatalError =
void 0;
function isFatalError(settings, error) {
if (settings.errorFilter === null) {
return true;
}
return !settings.errorFilter(error);
}
exports.isFatalError = isFatalError;
function isAppliedFilter(filter, value) {
return filter === null || filter(value);
}
exports.isAppliedFilter = isAppliedFilter;
function replacePathSegmentSeparator(filepath, separator) {
return filepath.split(/[/\\]/).join(separator);
}
exports.replacePathSegmentSeparator = replacePathSegmentSeparator;
function joinPathSegments(a, b, separator) {
if (a === "") {
return b;
}
if (a.endsWith(separator)) {
return a + b;
}
return a + separator + b;
}
exports.joinPathSegments = joinPathSegments;
},
3747: (__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const common = __nccwpck_require__(3285);
class Reader {
constructor(_root, _settings) {
this._root = _root;
this._settings = _settings;
this._root = common.replacePathSegmentSeparator(
_root,
_settings.pathSegmentSeparator,
);
}
}
exports["default"] = Reader;
},
5835: (__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const fsScandir = __nccwpck_require__(9096);
const common = __nccwpck_require__(3285);
const reader_1 = __nccwpck_require__(3747);
class SyncReader extends reader_1.default {
constructor() {
super(...arguments);
this._scandir = fsScandir.scandirSync;
this._storage = [];
this._queue = new Set();
}
read() {
this._pushToQueue(this._root, this._settings.basePath);
this._handleQueue();
return this._storage;
}
_pushToQueue(directory, base) {
this._queue.add({ directory, base });
}
_handleQueue() {
for (const item of this._queue.values()) {
this._handleDirectory(item.directory, item.base);
}
}
_handleDirectory(directory, base) {
try {
const entries = this._scandir(
directory,
this._settings.fsScandirSettings,
);
for (const entry of entries) {
this._handleEntry(entry, base);
}
} catch (error) {
this._handleError(error);
}
}
_handleError(error) {
if (!common.isFatalError(this._settings, error)) {
return;
}
throw error;
}
_handleEntry(entry, base) {
const fullpath = entry.path;
if (base !== undefined) {
entry.path = common.joinPathSegments(
base,
entry.name,
this._settings.pathSegmentSeparator,
);
}
if (common.isAppliedFilter(this._settings.entryFilter, entry)) {
this._pushToStorage(entry);
}
if (
entry.dirent.isDirectory() &&
common.isAppliedFilter(this._settings.deepFilter, entry)
) {
this._pushToQueue(
fullpath,
base === undefined ? undefined : entry.path,
);
}
}
_pushToStorage(entry) {
this._storage.push(entry);
}
}
exports["default"] = SyncReader;
},
328: (__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const path = __nccwpck_require__(6928);
const fsScandir = __nccwpck_require__(9096);
class Settings {
constructor(_options = {}) {
this._options = _options;
this.basePath = this._getValue(this._options.basePath, undefined);
this.concurrency = this._getValue(
this._options.concurrency,
Number.POSITIVE_INFINITY,
);
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,
path.sep,
);
this.fsScandirSettings = new fsScandir.Settings({
followSymbolicLinks: this._options.followSymbolicLinks,
fs: this._options.fs,
pathSegmentSeparator: this._options.pathSegmentSeparator,
stats: this._options.stats,
throwErrorOnBrokenSymbolicLink:
this._options.throwErrorOnBrokenSymbolicLink,
});
}
_getValue(option, value) {
return option !== null && option !== void 0 ? option : value;
}
}
exports["default"] = Settings;
},
7227: (module, __unused_webpack_exports, __nccwpck_require__) => {
"use strict";
const stringify = __nccwpck_require__(8602);
const compile = __nccwpck_require__(2358);
const expand = __nccwpck_require__(5671);
const parse = __nccwpck_require__(4180);
const braces = (input, options = {}) => {
let output = [];
if (Array.isArray(input)) {
for (const pattern of input) {
const result = braces.create(pattern, options);
if (Array.isArray(result)) {
output.push(...result);
} else {
output.push(result);
}
}
} else {
output = [].concat(braces.create(input, options));
}
if (options && options.expand === true && options.nodupes === true) {
output = [...new Set(output)];
}
return output;
};
braces.parse = (input, options = {}) => parse(input, options);
braces.stringify = (input, options = {}) => {
if (typeof input === "string") {
return stringify(braces.parse(input, options), options);
}
return stringify(input, options);
};
braces.compile = (input, options = {}) => {
if (typeof input === "string") {
input = braces.parse(input, options);
}
return compile(input, options);
};
braces.expand = (input, options = {}) => {
if (typeof input === "string") {
input = braces.parse(input, options);
}
let result = expand(input, options);
if (options.noempty === true) {
result = result.filter(Boolean);
}
if (options.nodupes === true) {
result = [...new Set(result)];
}
return result;
};
braces.create = (input, options = {}) => {
if (input === "" || input.length < 3) {
return [input];
}
return options.expand !== true
? braces.compile(input, options)
: braces.expand(input, options);
};
module.exports = braces;
},
2358: (module, __unused_webpack_exports, __nccwpck_require__) => {
"use strict";
const fill = __nccwpck_require__(6198);
const utils = __nccwpck_require__(7494);
const compile = (ast, options = {}) => {
const walk = (node, parent = {}) => {
const invalidBlock = utils.isInvalidBrace(parent);
const invalidNode =
node.invalid === true && options.escapeInvalid === true;
const invalid = invalidBlock === true || invalidNode === true;
const prefix = options.escapeInvalid === true ? "\\" : "";
let output = "";
if (node.isOpen === true) {
return prefix + node.value;
}
if (node.isClose === true) {
console.log("node.isClose", prefix, node.value);
return prefix + node.value;
}
if (node.type === "open") {
return invalid ? prefix + node.value : "(";
}
if (node.type === "close") {
return invalid ? prefix + node.value : ")";
}
if (node.type === "comma") {
return node.prev.type === "comma" ? "" : invalid ? node.value : "|";
}
if (node.value) {
return node.value;
}
if (node.nodes && node.ranges > 0) {
const args = utils.reduce(node.nodes);
const range = fill(...args, {
...options,
wrap: false,
toRegex: true,
strictZeros: true,
});
if (range.length !== 0) {
return args.length > 1 && range.length > 1 ? `(${range})` : range;
}
}
if (node.nodes) {
for (const child of node.nodes) {
output += walk(child, node);
}
}
return output;
};
return walk(ast);
};
module.exports = compile;
},
1230: (module) => {
"use strict";
module.exports = {
MAX_LENGTH: 1e4,
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",
};
},
5671: (module, __unused_webpack_exports, __nccwpck_require__) => {
"use strict";
const fill = __nccwpck_require__(6198);
const stringify = __nccwpck_require__(8602);
const utils = __nccwpck_require__(7494);
const append = (queue = "", stash = "", enclose = false) => {
const result = [];
queue = [].concat(queue);
stash = [].concat(stash);
if (!stash.length) return queue;
if (!queue.length) {
return enclose
? utils.flatten(stash).map((ele) => `{${ele}}`)
: stash;
}
for (const item of queue) {
if (Array.isArray(item)) {
for (const value of item) {
result.push(append(value, stash, enclose));
}
} else {
for (let ele of stash) {
if (enclose === true && typeof ele === "string") ele = `{${ele}}`;
result.push(
Array.isArray(ele) ? append(item, ele, enclose) : item + ele,
);
}
}
}
return utils.flatten(result);
};
const expand = (ast, options = {}) => {
const rangeLimit =
options.rangeLimit === undefined ? 1e3 : options.rangeLimit;
const walk = (node, parent = {}) => {
node.queue = [];
let p = parent;
let q = parent.queue;
while (p.type !== "brace" && p.type !== "root" && p.parent) {
p = p.parent;
q = p.queue;
}
if (node.invalid || node.dollar) {
q.push(append(q.pop(), stringify(node, options)));
return;
}
if (
node.type === "brace" &&
node.invalid !== true &&
node.nodes.length === 2
) {
q.push(append(q.pop(), ["{}"]));
return;
}
if (node.nodes && node.ranges > 0) {
const args = utils.reduce(node.nodes);
if (utils.exceedsLimit(...args, options.step, rangeLimit)) {
throw new RangeError(
"expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.",
);
}
let range = fill(...args, options);
if (range.length === 0) {
range = stringify(node, options);
}
q.push(append(q.pop(), range));
node.nodes = [];
return;
}
const enclose = utils.encloseBrace(node);
let queue = node.queue;
let block = node;
while (
block.type !== "brace" &&
block.type !== "root" &&
block.parent
) {
block = block.parent;
queue = block.queue;
}
for (let i = 0; i < node.nodes.length; i++) {
const child = node.nodes[i];
if (child.type === "comma" && node.type === "brace") {
if (i === 1) queue.push("");
queue.push("");
continue;
}
if (child.type === "close") {
q.push(append(q.pop(), queue, enclose));
continue;
}
if (child.value && child.type !== "open") {
queue.push(append(queue.pop(), child.value));
continue;
}
if (child.nodes) {
walk(child, node);
}
}
return queue;
};
return utils.flatten(walk(ast));
};
module.exports = expand;
},
4180: (module, __unused_webpack_exports, __nccwpck_require__) => {
"use strict";
const stringify = __nccwpck_require__(8602);
const {
MAX_LENGTH,
CHAR_BACKSLASH,
CHAR_BACKTICK,
CHAR_COMMA,
CHAR_DOT,
CHAR_LEFT_PARENTHESES,
CHAR_RIGHT_PARENTHESES,
CHAR_LEFT_CURLY_BRACE,
CHAR_RIGHT_CURLY_BRACE,
CHAR_LEFT_SQUARE_BRACKET,
CHAR_RIGHT_SQUARE_BRACKET,
CHAR_DOUBLE_QUOTE,
CHAR_SINGLE_QUOTE,
CHAR_NO_BREAK_SPACE,
CHAR_ZERO_WIDTH_NOBREAK_SPACE,
} = __nccwpck_require__(1230);
const parse = (input, options = {}) => {
if (typeof input !== "string") {
throw new TypeError("Expected a string");
}
const opts = options || {};
const max =
typeof opts.maxLength === "number"
? Math.min(MAX_LENGTH, opts.maxLength)
: MAX_LENGTH;
if (input.length > max) {
throw new SyntaxError(
`Input length (${input.length}), exceeds max characters (${max})`,
);
}
const ast = { type: "root", input, nodes: [] };
const stack = [ast];
let block = ast;
let prev = ast;
let brackets = 0;
const length = input.length;
let index = 0;
let depth = 0;
let value;
const advance = () => input[index++];
const push = (node) => {
if (node.type === "text" && prev.type === "dot") {
prev.type = "text";
}
if (prev && prev.type === "text" && node.type === "text") {
prev.value += node.value;
return;
}
block.nodes.push(node);
node.parent = block;
node.prev = prev;
prev = node;
return node;
};
push({ type: "bos" });
while (index < length) {
block = stack[stack.length - 1];
value = advance();
if (
value === CHAR_ZERO_WIDTH_NOBREAK_SPACE ||
value === CHAR_NO_BREAK_SPACE
) {
continue;
}
if (value === CHAR_BACKSLASH) {
push({
type: "text",
value: (options.keepEscaping ? value : "") + advance(),
});
continue;
}
if (value === CHAR_RIGHT_SQUARE_BRACKET) {
push({ type: "text", value: "\\" + value });
continue;
}
if (value === CHAR_LEFT_SQUARE_BRACKET) {
brackets++;
let next;
while (index < length && (next = advance())) {
value += next;
if (next === CHAR_LEFT_SQUARE_BRACKET) {
brackets++;
continue;
}
if (next === CHAR_BACKSLASH) {
value += advance();
continue;
}
if (next === CHAR_RIGHT_SQUARE_BRACKET) {
brackets--;
if (brackets === 0) {
break;
}
}
}
push({ type: "text", value });
continue;
}
if (value === CHAR_LEFT_PARENTHESES) {
block = push({ type: "paren", nodes: [] });
stack.push(block);
push({ type: "text", value });
continue;
}
if (value === CHAR_RIGHT_PARENTHESES) {
if (block.type !== "paren") {
push({ type: "text", value });
continue;
}
block = stack.pop();
push({ type: "text", value });
block = stack[stack.length - 1];
continue;
}
if (
value === CHAR_DOUBLE_QUOTE ||
value === CHAR_SINGLE_QUOTE ||
value === CHAR_BACKTICK
) {
const open = value;
let next;
if (options.keepQuotes !== true) {
value = "";
}
while (index < length && (next = advance())) {
if (next === CHAR_BACKSLASH) {
value += next + advance();
continue;
}
if (next === open) {
if (options.keepQuotes === true) value += next;
break;
}
value += next;
}
push({ type: "text", value });
continue;
}
if (value === CHAR_LEFT_CURLY_BRACE) {
depth++;
const dollar =
(prev.value && prev.value.slice(-1) === "$") ||
block.dollar === true;
const brace = {
type: "brace",
open: true,
close: false,
dollar,
depth,
commas: 0,
ranges: 0,
nodes: [],
};
block = push(brace);
stack.push(block);
push({ type: "open", value });
continue;
}
if (value === CHAR_RIGHT_CURLY_BRACE) {
if (block.type !== "brace") {
push({ type: "text", value });
continue;
}
const type = "close";
block = stack.pop();
block.close = true;
push({ type, value });
depth--;
block = stack[stack.length - 1];
continue;
}
if (value === CHAR_COMMA && depth > 0) {
if (block.ranges > 0) {
block.ranges = 0;
const open = block.nodes.shift();
block.nodes = [open, { type: "text", value: stringify(block) }];
}
push({ type: "comma", value });
block.commas++;
continue;
}
if (value === CHAR_DOT && depth > 0 && block.commas === 0) {
const siblings = block.nodes;
if (depth === 0 || siblings.length === 0) {
push({ type: "text", value });
continue;
}
if (prev.type === "dot") {
block.range = [];
prev.value += value;
prev.type = "range";
if (block.nodes.length !== 3 && block.nodes.length !== 5) {
block.invalid = true;
block.ranges = 0;
prev.type = "text";
continue;
}
block.ranges++;
block.args = [];
continue;
}
if (prev.type === "range") {
siblings.pop();
const before = siblings[siblings.length - 1];
before.value += prev.value + value;
prev = before;
block.ranges--;
continue;
}
push({ type: "dot", value });
continue;
}
push({ type: "text", value });
}
do {
block = stack.pop();
if (block.type !== "root") {
block.nodes.forEach((node) => {
if (!node.nodes) {
if (node.type === "open") node.isOpen = true;
if (node.type === "close") node.isClose = true;
if (!node.nodes) node.type = "text";
node.invalid = true;
}
});
const parent = stack[stack.length - 1];
const index = parent.nodes.indexOf(block);
parent.nodes.splice(index, 1, ...block.nodes);
}
} while (stack.length > 0);
push({ type: "eos" });
return ast;
};
module.exports = parse;
},
8602: (module, __unused_webpack_exports, __nccwpck_require__) => {
"use strict";
const utils = __nccwpck_require__(7494);
module.exports = (ast, options = {}) => {
const stringify = (node, parent = {}) => {
const invalidBlock =
options.escapeInvalid && utils.isInvalidBrace(parent);
const invalidNode =
node.invalid === true && options.escapeInvalid === true;
let output = "";
if (node.value) {
if ((invalidBlock || invalidNode) && utils.isOpenOrClose(node)) {
return "\\" + node.value;
}
return node.value;
}
if (node.value) {
return node.value;
}
if (node.nodes) {
for (const child of node.nodes) {
output += stringify(child);
}
}
return output;
};
return stringify(ast);
};
},
7494: (__unused_webpack_module, exports) => {
"use strict";
exports.isInteger = (num) => {
if (typeof num === "number") {
return Number.isInteger(num);
}
if (typeof num === "string" && num.trim() !== "") {
return Number.isInteger(Number(num));
}
return false;
};
exports.find = (node, type) =>
node.nodes.find((node) => node.type === type);
exports.exceedsLimit = (min, max, step = 1, limit) => {
if (limit === false) return false;
if (!exports.isInteger(min) || !exports.isInteger(max)) return false;
return (Number(max) - Number(min)) / Number(step) >= limit;
};
exports.escapeNode = (block, n = 0, type) => {
const node = block.nodes[n];
if (!node) return;
if