UNPKG

prebundle

Version:

Prebundle Node.js dependencies, output a single js file, a package.json file and the dts files.

1,387 lines (1,386 loc) 75.6 kB
(() => { var __webpack_modules__ = { 568: (module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const fs = __nccwpck_require__(551); const path = __nccwpck_require__(928); const mkdirsSync = __nccwpck_require__(90).mkdirsSync; const utimesMillisSync = __nccwpck_require__(847).utimesMillisSync; const stat = __nccwpck_require__(106); function copySync(src, dest, opts) { if (typeof opts === "function") { opts = { filter: opts }; } opts = opts || {}; opts.clobber = "clobber" in opts ? !!opts.clobber : true; opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber; if (opts.preserveTimestamps && process.arch === "ia32") { process.emitWarning( "Using the preserveTimestamps option in 32-bit node is not recommended;\n\n" + "\tsee https://github.com/jprichardson/node-fs-extra/issues/269", "Warning", "fs-extra-WARN0002", ); } const { srcStat, destStat } = stat.checkPathsSync( src, dest, "copy", opts, ); stat.checkParentPathsSync(src, srcStat, dest, "copy"); if (opts.filter && !opts.filter(src, dest)) return; const destParent = path.dirname(dest); if (!fs.existsSync(destParent)) mkdirsSync(destParent); return getStats(destStat, src, dest, opts); } function getStats(destStat, src, dest, opts) { const statSync = opts.dereference ? fs.statSync : fs.lstatSync; const srcStat = statSync(src); if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts); else if ( srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice() ) return onFile(srcStat, destStat, src, dest, opts); else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts); else if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`); else if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`); throw new Error(`Unknown file: ${src}`); } function onFile(srcStat, destStat, src, dest, opts) { if (!destStat) return copyFile(srcStat, src, dest, opts); return mayCopyFile(srcStat, src, dest, opts); } function mayCopyFile(srcStat, src, dest, opts) { if (opts.overwrite) { fs.unlinkSync(dest); return copyFile(srcStat, src, dest, opts); } else if (opts.errorOnExist) { throw new Error(`'${dest}' already exists`); } } function copyFile(srcStat, src, dest, opts) { fs.copyFileSync(src, dest); if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest); return setDestMode(dest, srcStat.mode); } function handleTimestamps(srcMode, src, dest) { if (fileIsNotWritable(srcMode)) makeFileWritable(dest, srcMode); return setDestTimestamps(src, dest); } function fileIsNotWritable(srcMode) { return (srcMode & 128) === 0; } function makeFileWritable(dest, srcMode) { return setDestMode(dest, srcMode | 128); } function setDestMode(dest, srcMode) { return fs.chmodSync(dest, srcMode); } function setDestTimestamps(src, dest) { const updatedSrcStat = fs.statSync(src); return utimesMillisSync( dest, updatedSrcStat.atime, updatedSrcStat.mtime, ); } function onDir(srcStat, destStat, src, dest, opts) { if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts); return copyDir(src, dest, opts); } function mkDirAndCopy(srcMode, src, dest, opts) { fs.mkdirSync(dest); copyDir(src, dest, opts); return setDestMode(dest, srcMode); } function copyDir(src, dest, opts) { const dir = fs.opendirSync(src); try { let dirent; while ((dirent = dir.readSync()) !== null) { copyDirItem(dirent.name, src, dest, opts); } } finally { dir.closeSync(); } } function copyDirItem(item, src, dest, opts) { const srcItem = path.join(src, item); const destItem = path.join(dest, item); if (opts.filter && !opts.filter(srcItem, destItem)) return; const { destStat } = stat.checkPathsSync( srcItem, destItem, "copy", opts, ); return getStats(destStat, srcItem, destItem, opts); } function onLink(destStat, src, dest, opts) { let resolvedSrc = fs.readlinkSync(src); if (opts.dereference) { resolvedSrc = path.resolve(process.cwd(), resolvedSrc); } if (!destStat) { return fs.symlinkSync(resolvedSrc, dest); } else { let resolvedDest; try { resolvedDest = fs.readlinkSync(dest); } catch (err) { if (err.code === "EINVAL" || err.code === "UNKNOWN") return fs.symlinkSync(resolvedSrc, dest); throw err; } if (opts.dereference) { resolvedDest = path.resolve(process.cwd(), resolvedDest); } if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) { throw new Error( `Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`, ); } if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) { throw new Error( `Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`, ); } return copyLink(resolvedSrc, dest); } } function copyLink(resolvedSrc, dest) { fs.unlinkSync(dest); return fs.symlinkSync(resolvedSrc, dest); } module.exports = copySync; }, 918: (module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const fs = __nccwpck_require__(389); const path = __nccwpck_require__(928); const { mkdirs } = __nccwpck_require__(90); const { pathExists } = __nccwpck_require__(812); const { utimesMillis } = __nccwpck_require__(847); const stat = __nccwpck_require__(106); async function copy(src, dest, opts = {}) { if (typeof opts === "function") { opts = { filter: opts }; } opts.clobber = "clobber" in opts ? !!opts.clobber : true; opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber; if (opts.preserveTimestamps && process.arch === "ia32") { process.emitWarning( "Using the preserveTimestamps option in 32-bit node is not recommended;\n\n" + "\tsee https://github.com/jprichardson/node-fs-extra/issues/269", "Warning", "fs-extra-WARN0001", ); } const { srcStat, destStat } = await stat.checkPaths( src, dest, "copy", opts, ); await stat.checkParentPaths(src, srcStat, dest, "copy"); const include = await runFilter(src, dest, opts); if (!include) return; const destParent = path.dirname(dest); const dirExists = await pathExists(destParent); if (!dirExists) { await mkdirs(destParent); } await getStatsAndPerformCopy(destStat, src, dest, opts); } async function runFilter(src, dest, opts) { if (!opts.filter) return true; return opts.filter(src, dest); } async function getStatsAndPerformCopy(destStat, src, dest, opts) { const statFn = opts.dereference ? fs.stat : fs.lstat; const srcStat = await statFn(src); if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts); if ( srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice() ) return onFile(srcStat, destStat, src, dest, opts); if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts); if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`); if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`); throw new Error(`Unknown file: ${src}`); } async function onFile(srcStat, destStat, src, dest, opts) { if (!destStat) return copyFile(srcStat, src, dest, opts); if (opts.overwrite) { await fs.unlink(dest); return copyFile(srcStat, src, dest, opts); } if (opts.errorOnExist) { throw new Error(`'${dest}' already exists`); } } async function copyFile(srcStat, src, dest, opts) { await fs.copyFile(src, dest); if (opts.preserveTimestamps) { if (fileIsNotWritable(srcStat.mode)) { await makeFileWritable(dest, srcStat.mode); } const updatedSrcStat = await fs.stat(src); await utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime); } return fs.chmod(dest, srcStat.mode); } function fileIsNotWritable(srcMode) { return (srcMode & 128) === 0; } function makeFileWritable(dest, srcMode) { return fs.chmod(dest, srcMode | 128); } async function onDir(srcStat, destStat, src, dest, opts) { if (!destStat) { await fs.mkdir(dest); } const promises = []; for await (const item of await fs.opendir(src)) { const srcItem = path.join(src, item.name); const destItem = path.join(dest, item.name); promises.push( runFilter(srcItem, destItem, opts).then((include) => { if (include) { return stat .checkPaths(srcItem, destItem, "copy", opts) .then(({ destStat }) => getStatsAndPerformCopy(destStat, srcItem, destItem, opts), ); } }), ); } await Promise.all(promises); if (!destStat) { await fs.chmod(dest, srcStat.mode); } } async function onLink(destStat, src, dest, opts) { let resolvedSrc = await fs.readlink(src); if (opts.dereference) { resolvedSrc = path.resolve(process.cwd(), resolvedSrc); } if (!destStat) { return fs.symlink(resolvedSrc, dest); } let resolvedDest = null; try { resolvedDest = await fs.readlink(dest); } catch (e) { if (e.code === "EINVAL" || e.code === "UNKNOWN") return fs.symlink(resolvedSrc, dest); throw e; } if (opts.dereference) { resolvedDest = path.resolve(process.cwd(), resolvedDest); } if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) { throw new Error( `Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`, ); } if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) { throw new Error( `Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`, ); } await fs.unlink(dest); return fs.symlink(resolvedSrc, dest); } module.exports = copy; }, 51: (module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const u = __nccwpck_require__(327).fromPromise; module.exports = { copy: u(__nccwpck_require__(918)), copySync: __nccwpck_require__(568), }; }, 43: (module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const u = __nccwpck_require__(327).fromPromise; const fs = __nccwpck_require__(389); const path = __nccwpck_require__(928); const mkdir = __nccwpck_require__(90); const remove = __nccwpck_require__(730); const emptyDir = u(async function emptyDir(dir) { let items; try { items = await fs.readdir(dir); } catch { return mkdir.mkdirs(dir); } return Promise.all( items.map((item) => remove.remove(path.join(dir, item))), ); }); function emptyDirSync(dir) { let items; try { items = fs.readdirSync(dir); } catch { return mkdir.mkdirsSync(dir); } items.forEach((item) => { item = path.join(dir, item); remove.removeSync(item); }); } module.exports = { emptyDirSync, emptydirSync: emptyDirSync, emptyDir, emptydir: emptyDir, }; }, 868: (module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const u = __nccwpck_require__(327).fromPromise; const path = __nccwpck_require__(928); const fs = __nccwpck_require__(389); const mkdir = __nccwpck_require__(90); async function createFile(file) { let stats; try { stats = await fs.stat(file); } catch {} if (stats && stats.isFile()) return; const dir = path.dirname(file); let dirStats = null; try { dirStats = await fs.stat(dir); } catch (err) { if (err.code === "ENOENT") { await mkdir.mkdirs(dir); await fs.writeFile(file, ""); return; } else { throw err; } } if (dirStats.isDirectory()) { await fs.writeFile(file, ""); } else { await fs.readdir(dir); } } function createFileSync(file) { let stats; try { stats = fs.statSync(file); } catch {} if (stats && stats.isFile()) return; const dir = path.dirname(file); try { if (!fs.statSync(dir).isDirectory()) { fs.readdirSync(dir); } } catch (err) { if (err && err.code === "ENOENT") mkdir.mkdirsSync(dir); else throw err; } fs.writeFileSync(file, ""); } module.exports = { createFile: u(createFile), createFileSync }; }, 524: (module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { createFile, createFileSync } = __nccwpck_require__(868); const { createLink, createLinkSync } = __nccwpck_require__(366); const { createSymlink, createSymlinkSync } = __nccwpck_require__(735); module.exports = { createFile, createFileSync, ensureFile: createFile, ensureFileSync: createFileSync, createLink, createLinkSync, ensureLink: createLink, ensureLinkSync: createLinkSync, createSymlink, createSymlinkSync, ensureSymlink: createSymlink, ensureSymlinkSync: createSymlinkSync, }; }, 366: (module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const u = __nccwpck_require__(327).fromPromise; const path = __nccwpck_require__(928); const fs = __nccwpck_require__(389); const mkdir = __nccwpck_require__(90); const { pathExists } = __nccwpck_require__(812); const { areIdentical } = __nccwpck_require__(106); async function createLink(srcpath, dstpath) { let dstStat; try { dstStat = await fs.lstat(dstpath); } catch {} let srcStat; try { srcStat = await fs.lstat(srcpath); } catch (err) { err.message = err.message.replace("lstat", "ensureLink"); throw err; } if (dstStat && areIdentical(srcStat, dstStat)) return; const dir = path.dirname(dstpath); const dirExists = await pathExists(dir); if (!dirExists) { await mkdir.mkdirs(dir); } await fs.link(srcpath, dstpath); } function createLinkSync(srcpath, dstpath) { let dstStat; try { dstStat = fs.lstatSync(dstpath); } catch {} try { const srcStat = fs.lstatSync(srcpath); if (dstStat && areIdentical(srcStat, dstStat)) return; } catch (err) { err.message = err.message.replace("lstat", "ensureLink"); throw err; } const dir = path.dirname(dstpath); const dirExists = fs.existsSync(dir); if (dirExists) return fs.linkSync(srcpath, dstpath); mkdir.mkdirsSync(dir); return fs.linkSync(srcpath, dstpath); } module.exports = { createLink: u(createLink), createLinkSync }; }, 850: (module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const path = __nccwpck_require__(928); const fs = __nccwpck_require__(389); const { pathExists } = __nccwpck_require__(812); const u = __nccwpck_require__(327).fromPromise; async function symlinkPaths(srcpath, dstpath) { if (path.isAbsolute(srcpath)) { try { await fs.lstat(srcpath); } catch (err) { err.message = err.message.replace("lstat", "ensureSymlink"); throw err; } return { toCwd: srcpath, toDst: srcpath }; } const dstdir = path.dirname(dstpath); const relativeToDst = path.join(dstdir, srcpath); const exists = await pathExists(relativeToDst); if (exists) { return { toCwd: relativeToDst, toDst: srcpath }; } try { await fs.lstat(srcpath); } catch (err) { err.message = err.message.replace("lstat", "ensureSymlink"); throw err; } return { toCwd: srcpath, toDst: path.relative(dstdir, srcpath) }; } function symlinkPathsSync(srcpath, dstpath) { if (path.isAbsolute(srcpath)) { const exists = fs.existsSync(srcpath); if (!exists) throw new Error("absolute srcpath does not exist"); return { toCwd: srcpath, toDst: srcpath }; } const dstdir = path.dirname(dstpath); const relativeToDst = path.join(dstdir, srcpath); const exists = fs.existsSync(relativeToDst); if (exists) { return { toCwd: relativeToDst, toDst: srcpath }; } const srcExists = fs.existsSync(srcpath); if (!srcExists) throw new Error("relative srcpath does not exist"); return { toCwd: srcpath, toDst: path.relative(dstdir, srcpath) }; } module.exports = { symlinkPaths: u(symlinkPaths), symlinkPathsSync }; }, 84: (module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const fs = __nccwpck_require__(389); const u = __nccwpck_require__(327).fromPromise; async function symlinkType(srcpath, type) { if (type) return type; let stats; try { stats = await fs.lstat(srcpath); } catch { return "file"; } return stats && stats.isDirectory() ? "dir" : "file"; } function symlinkTypeSync(srcpath, type) { if (type) return type; let stats; try { stats = fs.lstatSync(srcpath); } catch { return "file"; } return stats && stats.isDirectory() ? "dir" : "file"; } module.exports = { symlinkType: u(symlinkType), symlinkTypeSync }; }, 735: (module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const u = __nccwpck_require__(327).fromPromise; const path = __nccwpck_require__(928); const fs = __nccwpck_require__(389); const { mkdirs, mkdirsSync } = __nccwpck_require__(90); const { symlinkPaths, symlinkPathsSync } = __nccwpck_require__(850); const { symlinkType, symlinkTypeSync } = __nccwpck_require__(84); const { pathExists } = __nccwpck_require__(812); const { areIdentical } = __nccwpck_require__(106); async function createSymlink(srcpath, dstpath, type) { let stats; try { stats = await fs.lstat(dstpath); } catch {} if (stats && stats.isSymbolicLink()) { const [srcStat, dstStat] = await Promise.all([ fs.stat(srcpath), fs.stat(dstpath), ]); if (areIdentical(srcStat, dstStat)) return; } const relative = await symlinkPaths(srcpath, dstpath); srcpath = relative.toDst; const toType = await symlinkType(relative.toCwd, type); const dir = path.dirname(dstpath); if (!(await pathExists(dir))) { await mkdirs(dir); } return fs.symlink(srcpath, dstpath, toType); } function createSymlinkSync(srcpath, dstpath, type) { let stats; try { stats = fs.lstatSync(dstpath); } catch {} if (stats && stats.isSymbolicLink()) { const srcStat = fs.statSync(srcpath); const dstStat = fs.statSync(dstpath); if (areIdentical(srcStat, dstStat)) return; } const relative = symlinkPathsSync(srcpath, dstpath); srcpath = relative.toDst; type = symlinkTypeSync(relative.toCwd, type); const dir = path.dirname(dstpath); const exists = fs.existsSync(dir); if (exists) return fs.symlinkSync(srcpath, dstpath, type); mkdirsSync(dir); return fs.symlinkSync(srcpath, dstpath, type); } module.exports = { createSymlink: u(createSymlink), createSymlinkSync }; }, 389: (__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; const u = __nccwpck_require__(327).fromCallback; const fs = __nccwpck_require__(551); const api = [ "access", "appendFile", "chmod", "chown", "close", "copyFile", "cp", "fchmod", "fchown", "fdatasync", "fstat", "fsync", "ftruncate", "futimes", "glob", "lchmod", "lchown", "lutimes", "link", "lstat", "mkdir", "mkdtemp", "open", "opendir", "readdir", "readFile", "readlink", "realpath", "rename", "rm", "rmdir", "stat", "statfs", "symlink", "truncate", "unlink", "utimes", "writeFile", ].filter((key) => typeof fs[key] === "function"); Object.assign(exports, fs); api.forEach((method) => { exports[method] = u(fs[method]); }); exports.exists = function (filename, callback) { if (typeof callback === "function") { return fs.exists(filename, callback); } return new Promise((resolve) => fs.exists(filename, resolve)); }; exports.read = function (fd, buffer, offset, length, position, callback) { if (typeof callback === "function") { return fs.read(fd, buffer, offset, length, position, callback); } return new Promise((resolve, reject) => { fs.read( fd, buffer, offset, length, position, (err, bytesRead, buffer) => { if (err) return reject(err); resolve({ bytesRead, buffer }); }, ); }); }; exports.write = function (fd, buffer, ...args) { if (typeof args[args.length - 1] === "function") { return fs.write(fd, buffer, ...args); } return new Promise((resolve, reject) => { fs.write(fd, buffer, ...args, (err, bytesWritten, buffer) => { if (err) return reject(err); resolve({ bytesWritten, buffer }); }); }); }; exports.readv = function (fd, buffers, ...args) { if (typeof args[args.length - 1] === "function") { return fs.readv(fd, buffers, ...args); } return new Promise((resolve, reject) => { fs.readv(fd, buffers, ...args, (err, bytesRead, buffers) => { if (err) return reject(err); resolve({ bytesRead, buffers }); }); }); }; exports.writev = function (fd, buffers, ...args) { if (typeof args[args.length - 1] === "function") { return fs.writev(fd, buffers, ...args); } return new Promise((resolve, reject) => { fs.writev(fd, buffers, ...args, (err, bytesWritten, buffers) => { if (err) return reject(err); resolve({ bytesWritten, buffers }); }); }); }; if (typeof fs.realpath.native === "function") { exports.realpath.native = u(fs.realpath.native); } else { process.emitWarning( "fs.realpath.native is not a function. Is fs being monkey-patched?", "Warning", "fs-extra-WARN0003", ); } }, 977: (module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; module.exports = { ...__nccwpck_require__(389), ...__nccwpck_require__(51), ...__nccwpck_require__(43), ...__nccwpck_require__(524), ...__nccwpck_require__(916), ...__nccwpck_require__(90), ...__nccwpck_require__(251), ...__nccwpck_require__(692), ...__nccwpck_require__(812), ...__nccwpck_require__(730), }; }, 916: (module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const u = __nccwpck_require__(327).fromPromise; const jsonFile = __nccwpck_require__(330); jsonFile.outputJson = u(__nccwpck_require__(238)); jsonFile.outputJsonSync = __nccwpck_require__(72); jsonFile.outputJSON = jsonFile.outputJson; jsonFile.outputJSONSync = jsonFile.outputJsonSync; jsonFile.writeJSON = jsonFile.writeJson; jsonFile.writeJSONSync = jsonFile.writeJsonSync; jsonFile.readJSON = jsonFile.readJson; jsonFile.readJSONSync = jsonFile.readJsonSync; module.exports = jsonFile; }, 330: (module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const jsonFile = __nccwpck_require__(535); module.exports = { readJson: jsonFile.readFile, readJsonSync: jsonFile.readFileSync, writeJson: jsonFile.writeFile, writeJsonSync: jsonFile.writeFileSync, }; }, 72: (module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { stringify } = __nccwpck_require__(306); const { outputFileSync } = __nccwpck_require__(692); function outputJsonSync(file, data, options) { const str = stringify(data, options); outputFileSync(file, str, options); } module.exports = outputJsonSync; }, 238: (module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { stringify } = __nccwpck_require__(306); const { outputFile } = __nccwpck_require__(692); async function outputJson(file, data, options = {}) { const str = stringify(data, options); await outputFile(file, str, options); } module.exports = outputJson; }, 90: (module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const u = __nccwpck_require__(327).fromPromise; const { makeDir: _makeDir, makeDirSync } = __nccwpck_require__(904); const makeDir = u(_makeDir); module.exports = { mkdirs: makeDir, mkdirsSync: makeDirSync, mkdirp: makeDir, mkdirpSync: makeDirSync, ensureDir: makeDir, ensureDirSync: makeDirSync, }; }, 904: (module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const fs = __nccwpck_require__(389); const { checkPath } = __nccwpck_require__(963); const getMode = (options) => { const defaults = { mode: 511 }; if (typeof options === "number") return options; return { ...defaults, ...options }.mode; }; module.exports.makeDir = async (dir, options) => { checkPath(dir); return fs.mkdir(dir, { mode: getMode(options), recursive: true }); }; module.exports.makeDirSync = (dir, options) => { checkPath(dir); return fs.mkdirSync(dir, { mode: getMode(options), recursive: true }); }; }, 963: (module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const path = __nccwpck_require__(928); module.exports.checkPath = function checkPath(pth) { if (process.platform === "win32") { const pathHasInvalidWinCharacters = /[<>:"|?*]/.test( pth.replace(path.parse(pth).root, ""), ); if (pathHasInvalidWinCharacters) { const error = new Error(`Path contains invalid characters: ${pth}`); error.code = "EINVAL"; throw error; } } }; }, 251: (module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const u = __nccwpck_require__(327).fromPromise; module.exports = { move: u(__nccwpck_require__(758)), moveSync: __nccwpck_require__(640), }; }, 640: (module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const fs = __nccwpck_require__(551); const path = __nccwpck_require__(928); const copySync = __nccwpck_require__(51).copySync; const removeSync = __nccwpck_require__(730).removeSync; const mkdirpSync = __nccwpck_require__(90).mkdirpSync; const stat = __nccwpck_require__(106); function moveSync(src, dest, opts) { opts = opts || {}; const overwrite = opts.overwrite || opts.clobber || false; const { srcStat, isChangingCase = false } = stat.checkPathsSync( src, dest, "move", opts, ); stat.checkParentPathsSync(src, srcStat, dest, "move"); if (!isParentRoot(dest)) mkdirpSync(path.dirname(dest)); return doRename(src, dest, overwrite, isChangingCase); } function isParentRoot(dest) { const parent = path.dirname(dest); const parsedPath = path.parse(parent); return parsedPath.root === parent; } function doRename(src, dest, overwrite, isChangingCase) { if (isChangingCase) return rename(src, dest, overwrite); if (overwrite) { removeSync(dest); return rename(src, dest, overwrite); } if (fs.existsSync(dest)) throw new Error("dest already exists."); return rename(src, dest, overwrite); } function rename(src, dest, overwrite) { try { fs.renameSync(src, dest); } catch (err) { if (err.code !== "EXDEV") throw err; return moveAcrossDevice(src, dest, overwrite); } } function moveAcrossDevice(src, dest, overwrite) { const opts = { overwrite, errorOnExist: true, preserveTimestamps: true, }; copySync(src, dest, opts); return removeSync(src); } module.exports = moveSync; }, 758: (module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const fs = __nccwpck_require__(389); const path = __nccwpck_require__(928); const { copy } = __nccwpck_require__(51); const { remove } = __nccwpck_require__(730); const { mkdirp } = __nccwpck_require__(90); const { pathExists } = __nccwpck_require__(812); const stat = __nccwpck_require__(106); async function move(src, dest, opts = {}) { const overwrite = opts.overwrite || opts.clobber || false; const { srcStat, isChangingCase = false } = await stat.checkPaths( src, dest, "move", opts, ); await stat.checkParentPaths(src, srcStat, dest, "move"); const destParent = path.dirname(dest); const parsedParentPath = path.parse(destParent); if (parsedParentPath.root !== destParent) { await mkdirp(destParent); } return doRename(src, dest, overwrite, isChangingCase); } async function doRename(src, dest, overwrite, isChangingCase) { if (!isChangingCase) { if (overwrite) { await remove(dest); } else if (await pathExists(dest)) { throw new Error("dest already exists."); } } try { await fs.rename(src, dest); } catch (err) { if (err.code !== "EXDEV") { throw err; } await moveAcrossDevice(src, dest, overwrite); } } async function moveAcrossDevice(src, dest, overwrite) { const opts = { overwrite, errorOnExist: true, preserveTimestamps: true, }; await copy(src, dest, opts); return remove(src); } module.exports = move; }, 692: (module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const u = __nccwpck_require__(327).fromPromise; const fs = __nccwpck_require__(389); const path = __nccwpck_require__(928); const mkdir = __nccwpck_require__(90); const pathExists = __nccwpck_require__(812).pathExists; async function outputFile(file, data, encoding = "utf-8") { const dir = path.dirname(file); if (!(await pathExists(dir))) { await mkdir.mkdirs(dir); } return fs.writeFile(file, data, encoding); } function outputFileSync(file, ...args) { const dir = path.dirname(file); if (!fs.existsSync(dir)) { mkdir.mkdirsSync(dir); } fs.writeFileSync(file, ...args); } module.exports = { outputFile: u(outputFile), outputFileSync }; }, 812: (module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const u = __nccwpck_require__(327).fromPromise; const fs = __nccwpck_require__(389); function pathExists(path) { return fs .access(path) .then(() => true) .catch(() => false); } module.exports = { pathExists: u(pathExists), pathExistsSync: fs.existsSync, }; }, 730: (module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const fs = __nccwpck_require__(551); const u = __nccwpck_require__(327).fromCallback; function remove(path, callback) { fs.rm(path, { recursive: true, force: true }, callback); } function removeSync(path) { fs.rmSync(path, { recursive: true, force: true }); } module.exports = { remove: u(remove), removeSync }; }, 106: (module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const fs = __nccwpck_require__(389); const path = __nccwpck_require__(928); const u = __nccwpck_require__(327).fromPromise; function getStats(src, dest, opts) { const statFunc = opts.dereference ? (file) => fs.stat(file, { bigint: true }) : (file) => fs.lstat(file, { bigint: true }); return Promise.all([ statFunc(src), statFunc(dest).catch((err) => { if (err.code === "ENOENT") return null; throw err; }), ]).then(([srcStat, destStat]) => ({ srcStat, destStat })); } function getStatsSync(src, dest, opts) { let destStat; const statFunc = opts.dereference ? (file) => fs.statSync(file, { bigint: true }) : (file) => fs.lstatSync(file, { bigint: true }); const srcStat = statFunc(src); try { destStat = statFunc(dest); } catch (err) { if (err.code === "ENOENT") return { srcStat, destStat: null }; throw err; } return { srcStat, destStat }; } async function checkPaths(src, dest, funcName, opts) { const { srcStat, destStat } = await getStats(src, dest, opts); if (destStat) { if (areIdentical(srcStat, destStat)) { const srcBaseName = path.basename(src); const destBaseName = path.basename(dest); if ( funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase() ) { return { srcStat, destStat, isChangingCase: true }; } throw new Error("Source and destination must not be the same."); } if (srcStat.isDirectory() && !destStat.isDirectory()) { throw new Error( `Cannot overwrite non-directory '${dest}' with directory '${src}'.`, ); } if (!srcStat.isDirectory() && destStat.isDirectory()) { throw new Error( `Cannot overwrite directory '${dest}' with non-directory '${src}'.`, ); } } if (srcStat.isDirectory() && isSrcSubdir(src, dest)) { throw new Error(errMsg(src, dest, funcName)); } return { srcStat, destStat }; } function checkPathsSync(src, dest, funcName, opts) { const { srcStat, destStat } = getStatsSync(src, dest, opts); if (destStat) { if (areIdentical(srcStat, destStat)) { const srcBaseName = path.basename(src); const destBaseName = path.basename(dest); if ( funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase() ) { return { srcStat, destStat, isChangingCase: true }; } throw new Error("Source and destination must not be the same."); } if (srcStat.isDirectory() && !destStat.isDirectory()) { throw new Error( `Cannot overwrite non-directory '${dest}' with directory '${src}'.`, ); } if (!srcStat.isDirectory() && destStat.isDirectory()) { throw new Error( `Cannot overwrite directory '${dest}' with non-directory '${src}'.`, ); } } if (srcStat.isDirectory() && isSrcSubdir(src, dest)) { throw new Error(errMsg(src, dest, funcName)); } return { srcStat, destStat }; } async function checkParentPaths(src, srcStat, dest, funcName) { const srcParent = path.resolve(path.dirname(src)); const destParent = path.resolve(path.dirname(dest)); if ( destParent === srcParent || destParent === path.parse(destParent).root ) return; let destStat; try { destStat = await fs.stat(destParent, { bigint: true }); } catch (err) { if (err.code === "ENOENT") return; throw err; } if (areIdentical(srcStat, destStat)) { throw new Error(errMsg(src, dest, funcName)); } return checkParentPaths(src, srcStat, destParent, funcName); } function checkParentPathsSync(src, srcStat, dest, funcName) { const srcParent = path.resolve(path.dirname(src)); const destParent = path.resolve(path.dirname(dest)); if ( destParent === srcParent || destParent === path.parse(destParent).root ) return; let destStat; try { destStat = fs.statSync(destParent, { bigint: true }); } catch (err) { if (err.code === "ENOENT") return; throw err; } if (areIdentical(srcStat, destStat)) { throw new Error(errMsg(src, dest, funcName)); } return checkParentPathsSync(src, srcStat, destParent, funcName); } function areIdentical(srcStat, destStat) { return ( destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev ); } function isSrcSubdir(src, dest) { const srcArr = path .resolve(src) .split(path.sep) .filter((i) => i); const destArr = path .resolve(dest) .split(path.sep) .filter((i) => i); return srcArr.every((cur, i) => destArr[i] === cur); } function errMsg(src, dest, funcName) { return `Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.`; } module.exports = { checkPaths: u(checkPaths), checkPathsSync, checkParentPaths: u(checkParentPaths), checkParentPathsSync, isSrcSubdir, areIdentical, }; }, 847: (module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const fs = __nccwpck_require__(389); const u = __nccwpck_require__(327).fromPromise; async function utimesMillis(path, atime, mtime) { const fd = await fs.open(path, "r+"); let closeErr = null; try { await fs.futimes(fd, atime, mtime); } finally { try { await fs.close(fd); } catch (e) { closeErr = e; } } if (closeErr) { throw closeErr; } } function utimesMillisSync(path, atime, mtime) { const fd = fs.openSync(path, "r+"); fs.futimesSync(fd, atime, mtime); return fs.closeSync(fd); } module.exports = { utimesMillis: u(utimesMillis), utimesMillisSync }; }, 403: (module) => { "use strict"; module.exports = clone; var getPrototypeOf = Object.getPrototypeOf || function (obj) { return obj.__proto__; }; function clone(obj) { if (obj === null || typeof obj !== "object") return obj; if (obj instanceof Object) var copy = { __proto__: getPrototypeOf(obj) }; else var copy = Object.create(null); Object.getOwnPropertyNames(obj).forEach(function (key) { Object.defineProperty( copy, key, Object.getOwnPropertyDescriptor(obj, key), ); }); return copy; } }, 551: (module, __unused_webpack_exports, __nccwpck_require__) => { var fs = __nccwpck_require__(896); var polyfills = __nccwpck_require__(538); var legacy = __nccwpck_require__(611); var clone = __nccwpck_require__(403); var util = __nccwpck_require__(23); var gracefulQueue; var previousSymbol; if (typeof Symbol === "function" && typeof Symbol.for === "function") { gracefulQueue = Symbol.for("graceful-fs.queue"); previousSymbol = Symbol.for("graceful-fs.previous"); } else { gracefulQueue = "___graceful-fs.queue"; previousSymbol = "___graceful-fs.previous"; } function noop() {} function publishQueue(context, queue) { Object.defineProperty(context, gracefulQueue, { get: function () { return queue; }, }); } var debug = noop; if (util.debuglog) debug = util.debuglog("gfs4"); else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) debug = function () { var m = util.format.apply(util, arguments); m = "GFS4: " + m.split(/\n/).join("\nGFS4: "); console.error(m); }; if (!fs[gracefulQueue]) { var queue = global[gracefulQueue] || []; publishQueue(fs, queue); fs.close = (function (fs$close) { function close(fd, cb) { return fs$close.call(fs, fd, function (err) { if (!err) { resetQueue(); } if (typeof cb === "function") cb.apply(this, arguments); }); } Object.defineProperty(close, previousSymbol, { value: fs$close }); return close; })(fs.close); fs.closeSync = (function (fs$closeSync) { function closeSync(fd) { fs$closeSync.apply(fs, arguments); resetQueue(); } Object.defineProperty(closeSync, previousSymbol, { value: fs$closeSync, }); return closeSync; })(fs.closeSync); if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) { process.on("exit", function () { debug(fs[gracefulQueue]); __nccwpck_require__(613).equal(fs[gracefulQueue].length, 0); }); } } if (!global[gracefulQueue]) { publishQueue(global, fs[gracefulQueue]); } module.exports = patch(clone(fs)); if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) { module.exports = patch(fs); fs.__patched = true; } function patch(fs) { polyfills(fs); fs.gracefulify = patch; fs.createReadStream = createReadStream; fs.createWriteStream = createWriteStream; var fs$readFile = fs.readFile; fs.readFile = readFile; function readFile(path, options, cb) { if (typeof options === "function") (cb = options), (options = null); return go$readFile(path, options, cb); function go$readFile(path, options, cb, startTime) { return fs$readFile(path, options, function (err) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([ go$readFile, [path, options, cb], err, startTime || Date.now(), Date.now(), ]); else { if (typeof cb === "function") cb.apply(this, arguments); } }); } } var fs$writeFile = fs.writeFile; fs.writeFile = writeFile; function writeFile(path, data, options, cb) { if (typeof options === "function") (cb = options), (options = null); return go$writeFile(path, data, options, cb); function go$writeFile(path, data, options, cb, startTime) { return fs$writeFile(path, data, options, function (err) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([ go$writeFile, [path, data, options, cb], err, startTime || Date.now(), Date.now(), ]); else { if (typeof cb === "function") cb.apply(this, arguments); } }); } } var fs$appendFile = fs.appendFile; if (fs$appendFile) fs.appendFile = appendFile; function appendFile(path, data, options, cb) { if (typeof options === "function") (cb = options), (options = null); return go$appendFile(path, data, options, cb); function go$appendFile(path, data, options, cb, startTime) { return fs$appendFile(path, data, options, function (err) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([ go$appendFile, [path, data, options, cb], err, startTime || Date.now(), Date.now(), ]); else { if (typeof cb === "function") cb.apply(this, arguments); } }); } } var fs$copyFile = fs.copyFile; if (fs$copyFile) fs.copyFile = copyFile; function copyFile(src, dest, flags, cb) { if (typeof flags === "function") { cb = flags; flags = 0; } return go$copyFile(src, dest, flags, cb); function go$copyFile(src, dest, flags, cb, startTime) { return fs$copyFile(src, dest, flags, function (err) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([ go$copyFile, [src, dest, flags, cb], err, startTime || Date.now(), Date.now(), ]); else { if (typeof cb === "function") cb.apply(this, arguments); } }); } } var fs$readdir = fs.readdir; fs.readdir = readdir; var noReaddirOptionVersions = /^v[0-5]\./; function readdir(path, options, cb) { if (typeof options === "function") (cb = options), (options = null); var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir(path, options, cb, startTime) { return fs$readdir( path, fs$readdirCallback(path, options, cb, startTime), ); } : function go$readdir(path, options, cb, startTime) { return fs$readdir( path, options, fs$readdirCallback(path, options, cb, startTime), ); }; return go$readdir(path, options, cb); function fs$readdirCallback(path, options, cb, startTime) { return function (err, files) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([