From c973c406a9607352229b5de678290f206814bcde Mon Sep 17 00:00:00 2001 From: Bartosz Herba Date: Fri, 20 Dec 2024 09:37:15 +0100 Subject: [PATCH] chore: add custom license to licenses-check (#7364) --- actions/check-licenses/dist/index.js | 13922 +++++++++++---------- actions/check-licenses/dist/licenses.txt | 39 +- actions/check-licenses/package.json | 3 +- actions/check-licenses/src/licenses.ts | 1 + actions/check-licenses/yarn.lock | 696 + 5 files changed, 8173 insertions(+), 6488 deletions(-) create mode 100644 actions/check-licenses/yarn.lock diff --git a/actions/check-licenses/dist/index.js b/actions/check-licenses/dist/index.js index 2a58bdf9bf..0ac7df9fe3 100644 --- a/actions/check-licenses/dist/index.js +++ b/actions/check-licenses/dist/index.js @@ -35,7 +35,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) { Object.defineProperty(exports, "__esModule", ({ value: true })); /* eslint-disable unicorn/prefer-top-level-await */ const core = __importStar(__nccwpck_require__(2186)); -const license_checker_rseidelsohn_1 = __importDefault(__nccwpck_require__(5344)); +const license_checker_rseidelsohn_1 = __importDefault(__nccwpck_require__(2591)); const licenses_1 = __nccwpck_require__(3247); const npmPackages_1 = __nccwpck_require__(1865); async function run() { @@ -92,6 +92,7 @@ exports.ALLOWED_LICENSES = [ // If you download the package to your filesystem, you'll see that it's the Apache 2.0 license in fact 'Custom: https://github.com/paypal/Checkout-NodeJS-SDK/blob/master/LICENSE', 'Custom: VSFEL', + 'Custom: LICENSE', 'CC-BY-4.0', 'ISC', 'MIT', @@ -139,7 +140,11 @@ exports.EXCLUDE_NPM_PACKAGES = ['webpack', '@types', '@babel', 'k6', '@nuxt/ui-t var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; @@ -152,7 +157,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -214,13 +219,13 @@ class Command { } } function escapeData(s) { - return utils_1.toCommandValue(s) + return (0, utils_1.toCommandValue)(s) .replace(/%/g, '%25') .replace(/\r/g, '%0D') .replace(/\n/g, '%0A'); } function escapeProperty(s) { - return utils_1.toCommandValue(s) + return (0, utils_1.toCommandValue)(s) .replace(/%/g, '%25') .replace(/\r/g, '%0D') .replace(/\n/g, '%0A') @@ -238,7 +243,11 @@ function escapeProperty(s) { var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; @@ -251,7 +260,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -265,7 +274,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0; +exports.platform = exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = exports.markdownSummary = exports.summary = exports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0; const command_1 = __nccwpck_require__(7351); const file_command_1 = __nccwpck_require__(717); const utils_1 = __nccwpck_require__(5278); @@ -285,7 +294,7 @@ var ExitCode; * A code indicating that the action was a failure */ ExitCode[ExitCode["Failure"] = 1] = "Failure"; -})(ExitCode = exports.ExitCode || (exports.ExitCode = {})); +})(ExitCode || (exports.ExitCode = ExitCode = {})); //----------------------------------------------------------------------- // Variables //----------------------------------------------------------------------- @@ -296,13 +305,13 @@ var ExitCode; */ // eslint-disable-next-line @typescript-eslint/no-explicit-any function exportVariable(name, val) { - const convertedVal = utils_1.toCommandValue(val); + const convertedVal = (0, utils_1.toCommandValue)(val); process.env[name] = convertedVal; const filePath = process.env['GITHUB_ENV'] || ''; if (filePath) { - return file_command_1.issueFileCommand('ENV', file_command_1.prepareKeyValueMessage(name, val)); + return (0, file_command_1.issueFileCommand)('ENV', (0, file_command_1.prepareKeyValueMessage)(name, val)); } - command_1.issueCommand('set-env', { name }, convertedVal); + (0, command_1.issueCommand)('set-env', { name }, convertedVal); } exports.exportVariable = exportVariable; /** @@ -310,7 +319,7 @@ exports.exportVariable = exportVariable; * @param secret value of the secret */ function setSecret(secret) { - command_1.issueCommand('add-mask', {}, secret); + (0, command_1.issueCommand)('add-mask', {}, secret); } exports.setSecret = setSecret; /** @@ -320,10 +329,10 @@ exports.setSecret = setSecret; function addPath(inputPath) { const filePath = process.env['GITHUB_PATH'] || ''; if (filePath) { - file_command_1.issueFileCommand('PATH', inputPath); + (0, file_command_1.issueFileCommand)('PATH', inputPath); } else { - command_1.issueCommand('add-path', {}, inputPath); + (0, command_1.issueCommand)('add-path', {}, inputPath); } process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`; } @@ -398,10 +407,10 @@ exports.getBooleanInput = getBooleanInput; function setOutput(name, value) { const filePath = process.env['GITHUB_OUTPUT'] || ''; if (filePath) { - return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value)); + return (0, file_command_1.issueFileCommand)('OUTPUT', (0, file_command_1.prepareKeyValueMessage)(name, value)); } process.stdout.write(os.EOL); - command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(value)); + (0, command_1.issueCommand)('set-output', { name }, (0, utils_1.toCommandValue)(value)); } exports.setOutput = setOutput; /** @@ -410,7 +419,7 @@ exports.setOutput = setOutput; * */ function setCommandEcho(enabled) { - command_1.issue('echo', enabled ? 'on' : 'off'); + (0, command_1.issue)('echo', enabled ? 'on' : 'off'); } exports.setCommandEcho = setCommandEcho; //----------------------------------------------------------------------- @@ -441,7 +450,7 @@ exports.isDebug = isDebug; * @param message debug message */ function debug(message) { - command_1.issueCommand('debug', {}, message); + (0, command_1.issueCommand)('debug', {}, message); } exports.debug = debug; /** @@ -450,7 +459,7 @@ exports.debug = debug; * @param properties optional properties to add to the annotation. */ function error(message, properties = {}) { - command_1.issueCommand('error', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message); + (0, command_1.issueCommand)('error', (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); } exports.error = error; /** @@ -459,7 +468,7 @@ exports.error = error; * @param properties optional properties to add to the annotation. */ function warning(message, properties = {}) { - command_1.issueCommand('warning', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message); + (0, command_1.issueCommand)('warning', (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); } exports.warning = warning; /** @@ -468,7 +477,7 @@ exports.warning = warning; * @param properties optional properties to add to the annotation. */ function notice(message, properties = {}) { - command_1.issueCommand('notice', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message); + (0, command_1.issueCommand)('notice', (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); } exports.notice = notice; /** @@ -487,14 +496,14 @@ exports.info = info; * @param name The name of the output group */ function startGroup(name) { - command_1.issue('group', name); + (0, command_1.issue)('group', name); } exports.startGroup = startGroup; /** * End an output group. */ function endGroup() { - command_1.issue('endgroup'); + (0, command_1.issue)('endgroup'); } exports.endGroup = endGroup; /** @@ -532,9 +541,9 @@ exports.group = group; function saveState(name, value) { const filePath = process.env['GITHUB_STATE'] || ''; if (filePath) { - return file_command_1.issueFileCommand('STATE', file_command_1.prepareKeyValueMessage(name, value)); + return (0, file_command_1.issueFileCommand)('STATE', (0, file_command_1.prepareKeyValueMessage)(name, value)); } - command_1.issueCommand('save-state', { name }, utils_1.toCommandValue(value)); + (0, command_1.issueCommand)('save-state', { name }, (0, utils_1.toCommandValue)(value)); } exports.saveState = saveState; /** @@ -570,6 +579,10 @@ var path_utils_1 = __nccwpck_require__(2981); Object.defineProperty(exports, "toPosixPath", ({ enumerable: true, get: function () { return path_utils_1.toPosixPath; } })); Object.defineProperty(exports, "toWin32Path", ({ enumerable: true, get: function () { return path_utils_1.toWin32Path; } })); Object.defineProperty(exports, "toPlatformPath", ({ enumerable: true, get: function () { return path_utils_1.toPlatformPath; } })); +/** + * Platform utilities exports + */ +exports.platform = __importStar(__nccwpck_require__(5243)); //# sourceMappingURL=core.js.map /***/ }), @@ -582,7 +595,11 @@ Object.defineProperty(exports, "toPlatformPath", ({ enumerable: true, get: funct // For internal use, subject to change. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; @@ -595,7 +612,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -603,9 +620,9 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.prepareKeyValueMessage = exports.issueFileCommand = void 0; // We use any as a valid input type /* eslint-disable @typescript-eslint/no-explicit-any */ +const crypto = __importStar(__nccwpck_require__(6113)); const fs = __importStar(__nccwpck_require__(7147)); const os = __importStar(__nccwpck_require__(2037)); -const uuid_1 = __nccwpck_require__(5840); const utils_1 = __nccwpck_require__(5278); function issueFileCommand(command, message) { const filePath = process.env[`GITHUB_${command}`]; @@ -615,14 +632,14 @@ function issueFileCommand(command, message) { if (!fs.existsSync(filePath)) { throw new Error(`Missing file at path: ${filePath}`); } - fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, { + fs.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os.EOL}`, { encoding: 'utf8' }); } exports.issueFileCommand = issueFileCommand; function prepareKeyValueMessage(key, value) { - const delimiter = `ghadelimiter_${uuid_1.v4()}`; - const convertedValue = utils_1.toCommandValue(value); + const delimiter = `ghadelimiter_${crypto.randomUUID()}`; + const convertedValue = (0, utils_1.toCommandValue)(value); // These should realistically never happen, but just in case someone finds a // way to exploit uuid generation let's not allow keys or values that contain // the delimiter. @@ -707,9 +724,9 @@ class OidcClient { const encodedAudience = encodeURIComponent(audience); id_token_url = `${id_token_url}&audience=${encodedAudience}`; } - core_1.debug(`ID token url is ${id_token_url}`); + (0, core_1.debug)(`ID token url is ${id_token_url}`); const id_token = yield OidcClient.getCall(id_token_url); - core_1.setSecret(id_token); + (0, core_1.setSecret)(id_token); return id_token; } catch (error) { @@ -730,7 +747,11 @@ exports.OidcClient = OidcClient; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; @@ -743,7 +764,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -788,6 +809,107 @@ exports.toPlatformPath = toPlatformPath; /***/ }), +/***/ 5243: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getDetails = exports.isLinux = exports.isMacOS = exports.isWindows = exports.arch = exports.platform = void 0; +const os_1 = __importDefault(__nccwpck_require__(2037)); +const exec = __importStar(__nccwpck_require__(1514)); +const getWindowsInfo = () => __awaiter(void 0, void 0, void 0, function* () { + const { stdout: version } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', undefined, { + silent: true + }); + const { stdout: name } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', undefined, { + silent: true + }); + return { + name: name.trim(), + version: version.trim() + }; +}); +const getMacOsInfo = () => __awaiter(void 0, void 0, void 0, function* () { + var _a, _b, _c, _d; + const { stdout } = yield exec.getExecOutput('sw_vers', undefined, { + silent: true + }); + const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : ''; + const name = (_d = (_c = stdout.match(/ProductName:\s*(.+)/)) === null || _c === void 0 ? void 0 : _c[1]) !== null && _d !== void 0 ? _d : ''; + return { + name, + version + }; +}); +const getLinuxInfo = () => __awaiter(void 0, void 0, void 0, function* () { + const { stdout } = yield exec.getExecOutput('lsb_release', ['-i', '-r', '-s'], { + silent: true + }); + const [name, version] = stdout.trim().split('\n'); + return { + name, + version + }; +}); +exports.platform = os_1.default.platform(); +exports.arch = os_1.default.arch(); +exports.isWindows = exports.platform === 'win32'; +exports.isMacOS = exports.platform === 'darwin'; +exports.isLinux = exports.platform === 'linux'; +function getDetails() { + return __awaiter(this, void 0, void 0, function* () { + return Object.assign(Object.assign({}, (yield (exports.isWindows + ? getWindowsInfo() + : exports.isMacOS + ? getMacOsInfo() + : getLinuxInfo()))), { platform: exports.platform, + arch: exports.arch, + isWindows: exports.isWindows, + isMacOS: exports.isMacOS, + isLinux: exports.isLinux }); + }); +} +exports.getDetails = getDetails; +//# sourceMappingURL=platform.js.map + +/***/ }), + /***/ 1327: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { @@ -1125,6 +1247,741 @@ exports.toCommandProperties = toCommandProperties; /***/ }), +/***/ 1514: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getExecOutput = exports.exec = void 0; +const string_decoder_1 = __nccwpck_require__(1576); +const tr = __importStar(__nccwpck_require__(8159)); +/** + * Exec a command. + * Output will be streamed to the live console. + * Returns promise with return code + * + * @param commandLine command to execute (can include additional args). Must be correctly escaped. + * @param args optional arguments for tool. Escaping is handled by the lib. + * @param options optional exec options. See ExecOptions + * @returns Promise exit code + */ +function exec(commandLine, args, options) { + return __awaiter(this, void 0, void 0, function* () { + const commandArgs = tr.argStringToArray(commandLine); + if (commandArgs.length === 0) { + throw new Error(`Parameter 'commandLine' cannot be null or empty.`); + } + // Path to tool to execute should be first arg + const toolPath = commandArgs[0]; + args = commandArgs.slice(1).concat(args || []); + const runner = new tr.ToolRunner(toolPath, args, options); + return runner.exec(); + }); +} +exports.exec = exec; +/** + * Exec a command and get the output. + * Output will be streamed to the live console. + * Returns promise with the exit code and collected stdout and stderr + * + * @param commandLine command to execute (can include additional args). Must be correctly escaped. + * @param args optional arguments for tool. Escaping is handled by the lib. + * @param options optional exec options. See ExecOptions + * @returns Promise exit code, stdout, and stderr + */ +function getExecOutput(commandLine, args, options) { + var _a, _b; + return __awaiter(this, void 0, void 0, function* () { + let stdout = ''; + let stderr = ''; + //Using string decoder covers the case where a mult-byte character is split + const stdoutDecoder = new string_decoder_1.StringDecoder('utf8'); + const stderrDecoder = new string_decoder_1.StringDecoder('utf8'); + const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.stdout; + const originalStdErrListener = (_b = options === null || options === void 0 ? void 0 : options.listeners) === null || _b === void 0 ? void 0 : _b.stderr; + const stdErrListener = (data) => { + stderr += stderrDecoder.write(data); + if (originalStdErrListener) { + originalStdErrListener(data); + } + }; + const stdOutListener = (data) => { + stdout += stdoutDecoder.write(data); + if (originalStdoutListener) { + originalStdoutListener(data); + } + }; + const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener }); + const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); + //flush any remaining characters + stdout += stdoutDecoder.end(); + stderr += stderrDecoder.end(); + return { + exitCode, + stdout, + stderr + }; + }); +} +exports.getExecOutput = getExecOutput; +//# sourceMappingURL=exec.js.map + +/***/ }), + +/***/ 8159: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.argStringToArray = exports.ToolRunner = void 0; +const os = __importStar(__nccwpck_require__(2037)); +const events = __importStar(__nccwpck_require__(2361)); +const child = __importStar(__nccwpck_require__(2081)); +const path = __importStar(__nccwpck_require__(1017)); +const io = __importStar(__nccwpck_require__(7436)); +const ioUtil = __importStar(__nccwpck_require__(1962)); +const timers_1 = __nccwpck_require__(9512); +/* eslint-disable @typescript-eslint/unbound-method */ +const IS_WINDOWS = process.platform === 'win32'; +/* + * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way. + */ +class ToolRunner extends events.EventEmitter { + constructor(toolPath, args, options) { + super(); + if (!toolPath) { + throw new Error("Parameter 'toolPath' cannot be null or empty."); + } + this.toolPath = toolPath; + this.args = args || []; + this.options = options || {}; + } + _debug(message) { + if (this.options.listeners && this.options.listeners.debug) { + this.options.listeners.debug(message); + } + } + _getCommandString(options, noPrefix) { + const toolPath = this._getSpawnFileName(); + const args = this._getSpawnArgs(options); + let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool + if (IS_WINDOWS) { + // Windows + cmd file + if (this._isCmdFile()) { + cmd += toolPath; + for (const a of args) { + cmd += ` ${a}`; + } + } + // Windows + verbatim + else if (options.windowsVerbatimArguments) { + cmd += `"${toolPath}"`; + for (const a of args) { + cmd += ` ${a}`; + } + } + // Windows (regular) + else { + cmd += this._windowsQuoteCmdArg(toolPath); + for (const a of args) { + cmd += ` ${this._windowsQuoteCmdArg(a)}`; + } + } + } + else { + // OSX/Linux - this can likely be improved with some form of quoting. + // creating processes on Unix is fundamentally different than Windows. + // on Unix, execvp() takes an arg array. + cmd += toolPath; + for (const a of args) { + cmd += ` ${a}`; + } + } + return cmd; + } + _processLineBuffer(data, strBuffer, onLine) { + try { + let s = strBuffer + data.toString(); + let n = s.indexOf(os.EOL); + while (n > -1) { + const line = s.substring(0, n); + onLine(line); + // the rest of the string ... + s = s.substring(n + os.EOL.length); + n = s.indexOf(os.EOL); + } + return s; + } + catch (err) { + // streaming lines to console is best effort. Don't fail a build. + this._debug(`error processing line. Failed with error ${err}`); + return ''; + } + } + _getSpawnFileName() { + if (IS_WINDOWS) { + if (this._isCmdFile()) { + return process.env['COMSPEC'] || 'cmd.exe'; + } + } + return this.toolPath; + } + _getSpawnArgs(options) { + if (IS_WINDOWS) { + if (this._isCmdFile()) { + let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`; + for (const a of this.args) { + argline += ' '; + argline += options.windowsVerbatimArguments + ? a + : this._windowsQuoteCmdArg(a); + } + argline += '"'; + return [argline]; + } + } + return this.args; + } + _endsWith(str, end) { + return str.endsWith(end); + } + _isCmdFile() { + const upperToolPath = this.toolPath.toUpperCase(); + return (this._endsWith(upperToolPath, '.CMD') || + this._endsWith(upperToolPath, '.BAT')); + } + _windowsQuoteCmdArg(arg) { + // for .exe, apply the normal quoting rules that libuv applies + if (!this._isCmdFile()) { + return this._uvQuoteCmdArg(arg); + } + // otherwise apply quoting rules specific to the cmd.exe command line parser. + // the libuv rules are generic and are not designed specifically for cmd.exe + // command line parser. + // + // for a detailed description of the cmd.exe command line parser, refer to + // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912 + // need quotes for empty arg + if (!arg) { + return '""'; + } + // determine whether the arg needs to be quoted + const cmdSpecialChars = [ + ' ', + '\t', + '&', + '(', + ')', + '[', + ']', + '{', + '}', + '^', + '=', + ';', + '!', + "'", + '+', + ',', + '`', + '~', + '|', + '<', + '>', + '"' + ]; + let needsQuotes = false; + for (const char of arg) { + if (cmdSpecialChars.some(x => x === char)) { + needsQuotes = true; + break; + } + } + // short-circuit if quotes not needed + if (!needsQuotes) { + return arg; + } + // the following quoting rules are very similar to the rules that by libuv applies. + // + // 1) wrap the string in quotes + // + // 2) double-up quotes - i.e. " => "" + // + // this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately + // doesn't work well with a cmd.exe command line. + // + // note, replacing " with "" also works well if the arg is passed to a downstream .NET console app. + // for example, the command line: + // foo.exe "myarg:""my val""" + // is parsed by a .NET console app into an arg array: + // [ "myarg:\"my val\"" ] + // which is the same end result when applying libuv quoting rules. although the actual + // command line from libuv quoting rules would look like: + // foo.exe "myarg:\"my val\"" + // + // 3) double-up slashes that precede a quote, + // e.g. hello \world => "hello \world" + // hello\"world => "hello\\""world" + // hello\\"world => "hello\\\\""world" + // hello world\ => "hello world\\" + // + // technically this is not required for a cmd.exe command line, or the batch argument parser. + // the reasons for including this as a .cmd quoting rule are: + // + // a) this is optimized for the scenario where the argument is passed from the .cmd file to an + // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule. + // + // b) it's what we've been doing previously (by deferring to node default behavior) and we + // haven't heard any complaints about that aspect. + // + // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be + // escaped when used on the command line directly - even though within a .cmd file % can be escaped + // by using %%. + // + // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts + // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing. + // + // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would + // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the + // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args + // to an external program. + // + // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file. + // % can be escaped within a .cmd file. + let reverse = '"'; + let quoteHit = true; + for (let i = arg.length; i > 0; i--) { + // walk the string in reverse + reverse += arg[i - 1]; + if (quoteHit && arg[i - 1] === '\\') { + reverse += '\\'; // double the slash + } + else if (arg[i - 1] === '"') { + quoteHit = true; + reverse += '"'; // double the quote + } + else { + quoteHit = false; + } + } + reverse += '"'; + return reverse + .split('') + .reverse() + .join(''); + } + _uvQuoteCmdArg(arg) { + // Tool runner wraps child_process.spawn() and needs to apply the same quoting as + // Node in certain cases where the undocumented spawn option windowsVerbatimArguments + // is used. + // + // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV, + // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details), + // pasting copyright notice from Node within this function: + // + // Copyright Joyent, Inc. and other Node contributors. All rights reserved. + // + // Permission is hereby granted, free of charge, to any person obtaining a copy + // of this software and associated documentation files (the "Software"), to + // deal in the Software without restriction, including without limitation the + // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + // sell copies of the Software, and to permit persons to whom the Software is + // furnished to do so, subject to the following conditions: + // + // The above copyright notice and this permission notice shall be included in + // all copies or substantial portions of the Software. + // + // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + // IN THE SOFTWARE. + if (!arg) { + // Need double quotation for empty argument + return '""'; + } + if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) { + // No quotation needed + return arg; + } + if (!arg.includes('"') && !arg.includes('\\')) { + // No embedded double quotes or backslashes, so I can just wrap + // quote marks around the whole thing. + return `"${arg}"`; + } + // Expected input/output: + // input : hello"world + // output: "hello\"world" + // input : hello""world + // output: "hello\"\"world" + // input : hello\world + // output: hello\world + // input : hello\\world + // output: hello\\world + // input : hello\"world + // output: "hello\\\"world" + // input : hello\\"world + // output: "hello\\\\\"world" + // input : hello world\ + // output: "hello world\\" - note the comment in libuv actually reads "hello world\" + // but it appears the comment is wrong, it should be "hello world\\" + let reverse = '"'; + let quoteHit = true; + for (let i = arg.length; i > 0; i--) { + // walk the string in reverse + reverse += arg[i - 1]; + if (quoteHit && arg[i - 1] === '\\') { + reverse += '\\'; + } + else if (arg[i - 1] === '"') { + quoteHit = true; + reverse += '\\'; + } + else { + quoteHit = false; + } + } + reverse += '"'; + return reverse + .split('') + .reverse() + .join(''); + } + _cloneExecOptions(options) { + options = options || {}; + const result = { + cwd: options.cwd || process.cwd(), + env: options.env || process.env, + silent: options.silent || false, + windowsVerbatimArguments: options.windowsVerbatimArguments || false, + failOnStdErr: options.failOnStdErr || false, + ignoreReturnCode: options.ignoreReturnCode || false, + delay: options.delay || 10000 + }; + result.outStream = options.outStream || process.stdout; + result.errStream = options.errStream || process.stderr; + return result; + } + _getSpawnOptions(options, toolPath) { + options = options || {}; + const result = {}; + result.cwd = options.cwd; + result.env = options.env; + result['windowsVerbatimArguments'] = + options.windowsVerbatimArguments || this._isCmdFile(); + if (options.windowsVerbatimArguments) { + result.argv0 = `"${toolPath}"`; + } + return result; + } + /** + * Exec a tool. + * Output will be streamed to the live console. + * Returns promise with return code + * + * @param tool path to tool to exec + * @param options optional exec options. See ExecOptions + * @returns number + */ + exec() { + return __awaiter(this, void 0, void 0, function* () { + // root the tool path if it is unrooted and contains relative pathing + if (!ioUtil.isRooted(this.toolPath) && + (this.toolPath.includes('/') || + (IS_WINDOWS && this.toolPath.includes('\\')))) { + // prefer options.cwd if it is specified, however options.cwd may also need to be rooted + this.toolPath = path.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); + } + // if the tool is only a file name, then resolve it from the PATH + // otherwise verify it exists (add extension on Windows if necessary) + this.toolPath = yield io.which(this.toolPath, true); + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + this._debug(`exec tool: ${this.toolPath}`); + this._debug('arguments:'); + for (const arg of this.args) { + this._debug(` ${arg}`); + } + const optionsNonNull = this._cloneExecOptions(this.options); + if (!optionsNonNull.silent && optionsNonNull.outStream) { + optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL); + } + const state = new ExecState(optionsNonNull, this.toolPath); + state.on('debug', (message) => { + this._debug(message); + }); + if (this.options.cwd && !(yield ioUtil.exists(this.options.cwd))) { + return reject(new Error(`The cwd: ${this.options.cwd} does not exist!`)); + } + const fileName = this._getSpawnFileName(); + const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName)); + let stdbuffer = ''; + if (cp.stdout) { + cp.stdout.on('data', (data) => { + if (this.options.listeners && this.options.listeners.stdout) { + this.options.listeners.stdout(data); + } + if (!optionsNonNull.silent && optionsNonNull.outStream) { + optionsNonNull.outStream.write(data); + } + stdbuffer = this._processLineBuffer(data, stdbuffer, (line) => { + if (this.options.listeners && this.options.listeners.stdline) { + this.options.listeners.stdline(line); + } + }); + }); + } + let errbuffer = ''; + if (cp.stderr) { + cp.stderr.on('data', (data) => { + state.processStderr = true; + if (this.options.listeners && this.options.listeners.stderr) { + this.options.listeners.stderr(data); + } + if (!optionsNonNull.silent && + optionsNonNull.errStream && + optionsNonNull.outStream) { + const s = optionsNonNull.failOnStdErr + ? optionsNonNull.errStream + : optionsNonNull.outStream; + s.write(data); + } + errbuffer = this._processLineBuffer(data, errbuffer, (line) => { + if (this.options.listeners && this.options.listeners.errline) { + this.options.listeners.errline(line); + } + }); + }); + } + cp.on('error', (err) => { + state.processError = err.message; + state.processExited = true; + state.processClosed = true; + state.CheckComplete(); + }); + cp.on('exit', (code) => { + state.processExitCode = code; + state.processExited = true; + this._debug(`Exit code ${code} received from tool '${this.toolPath}'`); + state.CheckComplete(); + }); + cp.on('close', (code) => { + state.processExitCode = code; + state.processExited = true; + state.processClosed = true; + this._debug(`STDIO streams have closed for tool '${this.toolPath}'`); + state.CheckComplete(); + }); + state.on('done', (error, exitCode) => { + if (stdbuffer.length > 0) { + this.emit('stdline', stdbuffer); + } + if (errbuffer.length > 0) { + this.emit('errline', errbuffer); + } + cp.removeAllListeners(); + if (error) { + reject(error); + } + else { + resolve(exitCode); + } + }); + if (this.options.input) { + if (!cp.stdin) { + throw new Error('child process missing stdin'); + } + cp.stdin.end(this.options.input); + } + })); + }); + } +} +exports.ToolRunner = ToolRunner; +/** + * Convert an arg string to an array of args. Handles escaping + * + * @param argString string of arguments + * @returns string[] array of arguments + */ +function argStringToArray(argString) { + const args = []; + let inQuotes = false; + let escaped = false; + let arg = ''; + function append(c) { + // we only escape double quotes. + if (escaped && c !== '"') { + arg += '\\'; + } + arg += c; + escaped = false; + } + for (let i = 0; i < argString.length; i++) { + const c = argString.charAt(i); + if (c === '"') { + if (!escaped) { + inQuotes = !inQuotes; + } + else { + append(c); + } + continue; + } + if (c === '\\' && escaped) { + append(c); + continue; + } + if (c === '\\' && inQuotes) { + escaped = true; + continue; + } + if (c === ' ' && !inQuotes) { + if (arg.length > 0) { + args.push(arg); + arg = ''; + } + continue; + } + append(c); + } + if (arg.length > 0) { + args.push(arg.trim()); + } + return args; +} +exports.argStringToArray = argStringToArray; +class ExecState extends events.EventEmitter { + constructor(options, toolPath) { + super(); + this.processClosed = false; // tracks whether the process has exited and stdio is closed + this.processError = ''; + this.processExitCode = 0; + this.processExited = false; // tracks whether the process has exited + this.processStderr = false; // tracks whether stderr was written to + this.delay = 10000; // 10 seconds + this.done = false; + this.timeout = null; + if (!toolPath) { + throw new Error('toolPath must not be empty'); + } + this.options = options; + this.toolPath = toolPath; + if (options.delay) { + this.delay = options.delay; + } + } + CheckComplete() { + if (this.done) { + return; + } + if (this.processClosed) { + this._setResult(); + } + else if (this.processExited) { + this.timeout = timers_1.setTimeout(ExecState.HandleTimeout, this.delay, this); + } + } + _debug(message) { + this.emit('debug', message); + } + _setResult() { + // determine whether there is an error + let error; + if (this.processExited) { + if (this.processError) { + error = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`); + } + else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) { + error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); + } + else if (this.processStderr && this.options.failOnStdErr) { + error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); + } + } + // clear the timeout + if (this.timeout) { + clearTimeout(this.timeout); + this.timeout = null; + } + this.done = true; + this.emit('done', error, this.processExitCode); + } + static HandleTimeout(state) { + if (state.done) { + return; + } + if (!state.processClosed && state.processExited) { + const message = `The STDIO streams did not close within ${state.delay / + 1000} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`; + state._debug(message); + } + state._setResult(); + } +} +//# sourceMappingURL=toolrunner.js.map + +/***/ }), + /***/ 5526: /***/ (function(__unused_webpack_module, exports) { @@ -1780,7 +2637,7 @@ class HttpClient { } const usingSsl = parsedUrl.protocol === 'https:'; proxyAgent = new undici_1.ProxyAgent(Object.assign({ uri: proxyUrl.href, pipelining: !this._keepAlive ? 0 : 1 }, ((proxyUrl.username || proxyUrl.password) && { - token: `${proxyUrl.username}:${proxyUrl.password}` + token: `Basic ${Buffer.from(`${proxyUrl.username}:${proxyUrl.password}`).toString('base64')}` }))); this._proxyAgentDispatcher = proxyAgent; if (usingSsl && this._ignoreSslError) { @@ -1894,11 +2751,11 @@ function getProxyUrl(reqUrl) { })(); if (proxyVar) { try { - return new URL(proxyVar); + return new DecodedURL(proxyVar); } catch (_a) { if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://')) - return new URL(`http://${proxyVar}`); + return new DecodedURL(`http://${proxyVar}`); } } else { @@ -1957,10 +2814,519 @@ function isLoopbackAddress(host) { hostLower.startsWith('[::1]') || hostLower.startsWith('[0:0:0:0:0:0:0:1]')); } +class DecodedURL extends URL { + constructor(url, base) { + super(url, base); + this._decodedUsername = decodeURIComponent(super.username); + this._decodedPassword = decodeURIComponent(super.password); + } + get username() { + return this._decodedUsername; + } + get password() { + return this._decodedPassword; + } +} //# sourceMappingURL=proxy.js.map /***/ }), +/***/ 1962: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var _a; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getCmdPath = exports.tryGetExecutablePath = exports.isRooted = exports.isDirectory = exports.exists = exports.READONLY = exports.UV_FS_O_EXLOCK = exports.IS_WINDOWS = exports.unlink = exports.symlink = exports.stat = exports.rmdir = exports.rm = exports.rename = exports.readlink = exports.readdir = exports.open = exports.mkdir = exports.lstat = exports.copyFile = exports.chmod = void 0; +const fs = __importStar(__nccwpck_require__(7147)); +const path = __importStar(__nccwpck_require__(1017)); +_a = fs.promises +// export const {open} = 'fs' +, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.open = _a.open, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rm = _a.rm, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink; +// export const {open} = 'fs' +exports.IS_WINDOWS = process.platform === 'win32'; +// See https://github.com/nodejs/node/blob/d0153aee367422d0858105abec186da4dff0a0c5/deps/uv/include/uv/win.h#L691 +exports.UV_FS_O_EXLOCK = 0x10000000; +exports.READONLY = fs.constants.O_RDONLY; +function exists(fsPath) { + return __awaiter(this, void 0, void 0, function* () { + try { + yield exports.stat(fsPath); + } + catch (err) { + if (err.code === 'ENOENT') { + return false; + } + throw err; + } + return true; + }); +} +exports.exists = exists; +function isDirectory(fsPath, useStat = false) { + return __awaiter(this, void 0, void 0, function* () { + const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath); + return stats.isDirectory(); + }); +} +exports.isDirectory = isDirectory; +/** + * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like: + * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases). + */ +function isRooted(p) { + p = normalizeSeparators(p); + if (!p) { + throw new Error('isRooted() parameter "p" cannot be empty'); + } + if (exports.IS_WINDOWS) { + return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello + ); // e.g. C: or C:\hello + } + return p.startsWith('/'); +} +exports.isRooted = isRooted; +/** + * Best effort attempt to determine whether a file exists and is executable. + * @param filePath file path to check + * @param extensions additional file extensions to try + * @return if file exists and is executable, returns the file path. otherwise empty string. + */ +function tryGetExecutablePath(filePath, extensions) { + return __awaiter(this, void 0, void 0, function* () { + let stats = undefined; + try { + // test file exists + stats = yield exports.stat(filePath); + } + catch (err) { + if (err.code !== 'ENOENT') { + // eslint-disable-next-line no-console + console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); + } + } + if (stats && stats.isFile()) { + if (exports.IS_WINDOWS) { + // on Windows, test for valid extension + const upperExt = path.extname(filePath).toUpperCase(); + if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) { + return filePath; + } + } + else { + if (isUnixExecutable(stats)) { + return filePath; + } + } + } + // try each extension + const originalFilePath = filePath; + for (const extension of extensions) { + filePath = originalFilePath + extension; + stats = undefined; + try { + stats = yield exports.stat(filePath); + } + catch (err) { + if (err.code !== 'ENOENT') { + // eslint-disable-next-line no-console + console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); + } + } + if (stats && stats.isFile()) { + if (exports.IS_WINDOWS) { + // preserve the case of the actual file (since an extension was appended) + try { + const directory = path.dirname(filePath); + const upperName = path.basename(filePath).toUpperCase(); + for (const actualName of yield exports.readdir(directory)) { + if (upperName === actualName.toUpperCase()) { + filePath = path.join(directory, actualName); + break; + } + } + } + catch (err) { + // eslint-disable-next-line no-console + console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`); + } + return filePath; + } + else { + if (isUnixExecutable(stats)) { + return filePath; + } + } + } + } + return ''; + }); +} +exports.tryGetExecutablePath = tryGetExecutablePath; +function normalizeSeparators(p) { + p = p || ''; + if (exports.IS_WINDOWS) { + // convert slashes on Windows + p = p.replace(/\//g, '\\'); + // remove redundant slashes + return p.replace(/\\\\+/g, '\\'); + } + // remove redundant slashes + return p.replace(/\/\/+/g, '/'); +} +// on Mac/Linux, test the execute bit +// R W X R W X R W X +// 256 128 64 32 16 8 4 2 1 +function isUnixExecutable(stats) { + return ((stats.mode & 1) > 0 || + ((stats.mode & 8) > 0 && stats.gid === process.getgid()) || + ((stats.mode & 64) > 0 && stats.uid === process.getuid())); +} +// Get the path of cmd.exe in windows +function getCmdPath() { + var _a; + return (_a = process.env['COMSPEC']) !== null && _a !== void 0 ? _a : `cmd.exe`; +} +exports.getCmdPath = getCmdPath; +//# sourceMappingURL=io-util.js.map + +/***/ }), + +/***/ 7436: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.findInPath = exports.which = exports.mkdirP = exports.rmRF = exports.mv = exports.cp = void 0; +const assert_1 = __nccwpck_require__(9491); +const path = __importStar(__nccwpck_require__(1017)); +const ioUtil = __importStar(__nccwpck_require__(1962)); +/** + * Copies a file or folder. + * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js + * + * @param source source path + * @param dest destination path + * @param options optional. See CopyOptions. + */ +function cp(source, dest, options = {}) { + return __awaiter(this, void 0, void 0, function* () { + const { force, recursive, copySourceDirectory } = readCopyOptions(options); + const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null; + // Dest is an existing file, but not forcing + if (destStat && destStat.isFile() && !force) { + return; + } + // If dest is an existing directory, should copy inside. + const newDest = destStat && destStat.isDirectory() && copySourceDirectory + ? path.join(dest, path.basename(source)) + : dest; + if (!(yield ioUtil.exists(source))) { + throw new Error(`no such file or directory: ${source}`); + } + const sourceStat = yield ioUtil.stat(source); + if (sourceStat.isDirectory()) { + if (!recursive) { + throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`); + } + else { + yield cpDirRecursive(source, newDest, 0, force); + } + } + else { + if (path.relative(source, newDest) === '') { + // a file cannot be copied to itself + throw new Error(`'${newDest}' and '${source}' are the same file`); + } + yield copyFile(source, newDest, force); + } + }); +} +exports.cp = cp; +/** + * Moves a path. + * + * @param source source path + * @param dest destination path + * @param options optional. See MoveOptions. + */ +function mv(source, dest, options = {}) { + return __awaiter(this, void 0, void 0, function* () { + if (yield ioUtil.exists(dest)) { + let destExists = true; + if (yield ioUtil.isDirectory(dest)) { + // If dest is directory copy src into dest + dest = path.join(dest, path.basename(source)); + destExists = yield ioUtil.exists(dest); + } + if (destExists) { + if (options.force == null || options.force) { + yield rmRF(dest); + } + else { + throw new Error('Destination already exists'); + } + } + } + yield mkdirP(path.dirname(dest)); + yield ioUtil.rename(source, dest); + }); +} +exports.mv = mv; +/** + * Remove a path recursively with force + * + * @param inputPath path to remove + */ +function rmRF(inputPath) { + return __awaiter(this, void 0, void 0, function* () { + if (ioUtil.IS_WINDOWS) { + // Check for invalid characters + // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file + if (/[*"<>|]/.test(inputPath)) { + throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows'); + } + } + try { + // note if path does not exist, error is silent + yield ioUtil.rm(inputPath, { + force: true, + maxRetries: 3, + recursive: true, + retryDelay: 300 + }); + } + catch (err) { + throw new Error(`File was unable to be removed ${err}`); + } + }); +} +exports.rmRF = rmRF; +/** + * Make a directory. Creates the full path with folders in between + * Will throw if it fails + * + * @param fsPath path to create + * @returns Promise + */ +function mkdirP(fsPath) { + return __awaiter(this, void 0, void 0, function* () { + assert_1.ok(fsPath, 'a path argument must be provided'); + yield ioUtil.mkdir(fsPath, { recursive: true }); + }); +} +exports.mkdirP = mkdirP; +/** + * Returns path of a tool had the tool actually been invoked. Resolves via paths. + * If you check and the tool does not exist, it will throw. + * + * @param tool name of the tool + * @param check whether to check if tool exists + * @returns Promise path to tool + */ +function which(tool, check) { + return __awaiter(this, void 0, void 0, function* () { + if (!tool) { + throw new Error("parameter 'tool' is required"); + } + // recursive when check=true + if (check) { + const result = yield which(tool, false); + if (!result) { + if (ioUtil.IS_WINDOWS) { + throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`); + } + else { + throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`); + } + } + return result; + } + const matches = yield findInPath(tool); + if (matches && matches.length > 0) { + return matches[0]; + } + return ''; + }); +} +exports.which = which; +/** + * Returns a list of all occurrences of the given tool on the system path. + * + * @returns Promise the paths of the tool + */ +function findInPath(tool) { + return __awaiter(this, void 0, void 0, function* () { + if (!tool) { + throw new Error("parameter 'tool' is required"); + } + // build the list of extensions to try + const extensions = []; + if (ioUtil.IS_WINDOWS && process.env['PATHEXT']) { + for (const extension of process.env['PATHEXT'].split(path.delimiter)) { + if (extension) { + extensions.push(extension); + } + } + } + // if it's rooted, return it if exists. otherwise return empty. + if (ioUtil.isRooted(tool)) { + const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions); + if (filePath) { + return [filePath]; + } + return []; + } + // if any path separators, return empty + if (tool.includes(path.sep)) { + return []; + } + // build the list of directories + // + // Note, technically "where" checks the current directory on Windows. From a toolkit perspective, + // it feels like we should not do this. Checking the current directory seems like more of a use + // case of a shell, and the which() function exposed by the toolkit should strive for consistency + // across platforms. + const directories = []; + if (process.env.PATH) { + for (const p of process.env.PATH.split(path.delimiter)) { + if (p) { + directories.push(p); + } + } + } + // find all matches + const matches = []; + for (const directory of directories) { + const filePath = yield ioUtil.tryGetExecutablePath(path.join(directory, tool), extensions); + if (filePath) { + matches.push(filePath); + } + } + return matches; + }); +} +exports.findInPath = findInPath; +function readCopyOptions(options) { + const force = options.force == null ? true : options.force; + const recursive = Boolean(options.recursive); + const copySourceDirectory = options.copySourceDirectory == null + ? true + : Boolean(options.copySourceDirectory); + return { force, recursive, copySourceDirectory }; +} +function cpDirRecursive(sourceDir, destDir, currentDepth, force) { + return __awaiter(this, void 0, void 0, function* () { + // Ensure there is not a run away recursive copy + if (currentDepth >= 255) + return; + currentDepth++; + yield mkdirP(destDir); + const files = yield ioUtil.readdir(sourceDir); + for (const fileName of files) { + const srcFile = `${sourceDir}/${fileName}`; + const destFile = `${destDir}/${fileName}`; + const srcFileStat = yield ioUtil.lstat(srcFile); + if (srcFileStat.isDirectory()) { + // Recurse + yield cpDirRecursive(srcFile, destFile, currentDepth, force); + } + else { + yield copyFile(srcFile, destFile, force); + } + } + // Change the mode for the newly created directory + yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); + }); +} +// Buffered file copy +function copyFile(srcFile, destFile, force) { + return __awaiter(this, void 0, void 0, function* () { + if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) { + // unlink/re-link it + try { + yield ioUtil.lstat(destFile); + yield ioUtil.unlink(destFile); + } + catch (e) { + // Try to override file permission + if (e.code === 'EPERM') { + yield ioUtil.chmod(destFile, '0666'); + yield ioUtil.unlink(destFile); + } + // other errors = it doesn't exist, no work to do + } + // Copy over symlink + const symlinkFull = yield ioUtil.readlink(srcFile); + yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null); + } + else if (!(yield ioUtil.exists(destFile)) || force) { + yield ioUtil.copyFile(srcFile, destFile); + } + }); +} +//# sourceMappingURL=io.js.map + +/***/ }), + /***/ 1573: /***/ ((module) => { @@ -5024,14 +6390,17 @@ function useColors() { return false; } + let m; + // Is webkit? http://stackoverflow.com/a/16459606/376773 // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 + // eslint-disable-next-line no-return-assign return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || // Is firebug? http://stackoverflow.com/a/398120/376773 (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || // Is firefox >= v31? // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages - (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || + (typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31) || // Double check webkit in userAgent just in case we are in a worker (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); } @@ -5341,24 +6710,62 @@ function setup(env) { createDebug.names = []; createDebug.skips = []; - let i; - const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); - const len = split.length; + const split = (typeof namespaces === 'string' ? namespaces : '') + .trim() + .replace(' ', ',') + .split(',') + .filter(Boolean); - for (i = 0; i < len; i++) { - if (!split[i]) { - // ignore empty strings - continue; + for (const ns of split) { + if (ns[0] === '-') { + createDebug.skips.push(ns.slice(1)); + } else { + createDebug.names.push(ns); } + } + } - namespaces = split[i].replace(/\*/g, '.*?'); - - if (namespaces[0] === '-') { - createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$')); + /** + * Checks if the given string matches a namespace template, honoring + * asterisks as wildcards. + * + * @param {String} search + * @param {String} template + * @return {Boolean} + */ + function matchesTemplate(search, template) { + let searchIndex = 0; + let templateIndex = 0; + let starIndex = -1; + let matchIndex = 0; + + while (searchIndex < search.length) { + if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) { + // Match character or proceed with wildcard + if (template[templateIndex] === '*') { + starIndex = templateIndex; + matchIndex = searchIndex; + templateIndex++; // Skip the '*' + } else { + searchIndex++; + templateIndex++; + } + } else if (starIndex !== -1) { // eslint-disable-line no-negated-condition + // Backtrack to the last '*' and try to match more characters + templateIndex = starIndex + 1; + matchIndex++; + searchIndex = matchIndex; } else { - createDebug.names.push(new RegExp('^' + namespaces + '$')); + return false; // No match } } + + // Handle trailing '*' in template + while (templateIndex < template.length && template[templateIndex] === '*') { + templateIndex++; + } + + return templateIndex === template.length; } /** @@ -5369,8 +6776,8 @@ function setup(env) { */ function disable() { const namespaces = [ - ...createDebug.names.map(toNamespace), - ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace) + ...createDebug.names, + ...createDebug.skips.map(namespace => '-' + namespace) ].join(','); createDebug.enable(''); return namespaces; @@ -5384,21 +6791,14 @@ function setup(env) { * @api public */ function enabled(name) { - if (name[name.length - 1] === '*') { - return true; - } - - let i; - let len; - - for (i = 0, len = createDebug.skips.length; i < len; i++) { - if (createDebug.skips[i].test(name)) { + for (const skip of createDebug.skips) { + if (matchesTemplate(name, skip)) { return false; } } - for (i = 0, len = createDebug.names.length; i < len; i++) { - if (createDebug.names[i].test(name)) { + for (const ns of createDebug.names) { + if (matchesTemplate(name, ns)) { return true; } } @@ -5406,19 +6806,6 @@ function setup(env) { return false; } - /** - * Convert regexp to namespace - * - * @param {RegExp} regxep - * @return {String} namespace - * @api private - */ - function toNamespace(regexp) { - return regexp.toString() - .substring(2, regexp.toString().length - 2) - .replace(/\.\*\?$/, '*'); - } - /** * Coerce `val`. * @@ -5462,13 +6849,13 @@ module.exports = setup; if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) { module.exports = __nccwpck_require__(8222); } else { - module.exports = __nccwpck_require__(4874); + module.exports = __nccwpck_require__(5332); } /***/ }), -/***/ 4874: +/***/ 5332: /***/ ((module, exports, __nccwpck_require__) => { /** @@ -5660,11 +7047,11 @@ function getDate() { } /** - * Invokes `util.format()` with the specified arguments and writes to stderr. + * Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr. */ function log(...args) { - return process.stderr.write(util.format(...args) + '\n'); + return process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + '\n'); } /** @@ -6988,7 +8375,11 @@ module.exports = (giturl, opts, { gitHosts, protocols }) => { const maybeJoin = (...args) => args.every(arg => arg) ? args.join('') : '' const maybeEncode = (arg) => arg ? encodeURIComponent(arg) : '' -const formatHashFragment = (f) => f.toLowerCase().replace(/^\W+|\/|\W+$/g, '').replace(/\W+/g, '-') +const formatHashFragment = (f) => f.toLowerCase() + .replace(/^\W+/g, '') // strip leading non-characters + .replace(/(? @@ -7708,4464 +9099,2998 @@ parseJsonError.noExceptions = (raw, reviver) => { /***/ }), -/***/ 8423: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const spdxExpressionParse = __nccwpck_require__(5254); - -const MIT_LICENSE = /ermission is hereby granted, free of charge, to any/; -const BSD_LICENSE = /edistribution and use in source and binary forms, with or withou/; -const BSD_SOURCE_CODE_LICENSE = /edistribution and use of this software in source and binary forms, with or withou/; -const WTFPL_LICENSE = /DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE/; -const ISC_LICENSE = /The ISC License/; -const HIPPOCRATIC_LICENSE = /Hippocratic License/; -const MIT = /\bMIT\b/; -const BSD = /\bBSD\b/; -const ISC = /\bISC\b/; -const GPL = /\bGNU GENERAL PUBLIC LICENSE\s*Version ([^,]*)/i; -const LGPL = /(?:LESSER|LIBRARY) GENERAL PUBLIC LICENSE\s*Version ([^,]*)/i; -const APACHE_VERSION = /\bApache License\s*Version ([^,\s]*)/i; -const APACHE = /\bApache License\b/; -const APACHE_VERSION_SHORT = /\bApache ([^,\s]*)/i; -const WTFPL = /\bWTFPL\b/; -const ZERO_PARITY_LICENSE = /\bParity\b/; -// https://creativecommons.org/publicdomain/zero/1.0/ -const CC0_1_0 = - /The\s+person\s+who\s+associated\s+a\s+work\s+with\s+this\s+deed\s+has\s+dedicated\s+the\s+work\s+to\s+the\s+public\s+domain\s+by\s+waiving\s+all\s+of\s+his\s+or\s+her\s+rights\s+to\s+the\s+work\s+worldwide\s+under\s+copyright\s+law,\s+including\s+all\s+related\s+and\s+neighboring\s+rights,\s+to\s+the\s+extent\s+allowed\s+by\s+law.\s+You\s+can\s+copy,\s+modify,\s+distribute\s+and\s+perform\s+the\s+work,\s+even\s+for\s+commercial\s+purposes,\s+all\s+without\s+asking\s+permission./i; // jshint ignore:line -const PUBLIC_DOMAIN = /[Pp]ublic[\-_ ]*[Dd]omain/; -const IS_URL = /(https?:\/\/[-a-zA-Z0-9\/.]*)/; -const CONTAINS_URLS_ENDING_WITH = /(.svg|.gif|.png|.jpg|.jpeg)$/i; -const CONTAINS_LICENSE_TERM = /(license|licence|lizenz)/gi; -const IS_FILE_REFERENCE = /SEE LICENSE IN (.*)/i; -const UNLICENSED = /UNLICENSED/i; +/***/ 2061: +/***/ ((module, exports, __nccwpck_require__) => { -module.exports = function getLicenseTitle(str = 'undefined') { - if (typeof str !== 'string') { - throw new Error( - `Wrong type for parameter "str" ("${str}"): Must be of type string`, - 'lib/getLicenseTitle.js', - 24, - ); - } +/* module decorator */ module = __nccwpck_require__.nmd(module); +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ - let match; - let version; +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; - try { - // Simply check if the string is a valid SPDX expression: - spdxExpressionParse(str); +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; - // No need for additional parsing efforts: - return str; - } catch (error) { - // Fail silently and continue with additional parsing efforts: - } +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; - if (str) { - str = str.replace('\n', ''); - } +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + weakMapTag = '[object WeakMap]'; - if (!str || str === 'undefined') { - return 'Undefined'; - } +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; - if (ZERO_PARITY_LICENSE.test(str)) { - return 'Zero Parity*'; - } +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; - if (ISC_LICENSE.test(str)) { - return 'ISC*'; - } +/** Used to match `RegExp` flags from their coerced string values. */ +var reFlags = /\w*$/; - if (HIPPOCRATIC_LICENSE.test(str)) { - return 'Hippocratic-2.1*'; - } +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; - if (MIT_LICENSE.test(str)) { - return 'MIT*'; - } +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; - if (BSD_LICENSE.test(str)) { - return 'BSD*'; - } +/** Used to identify `toStringTag` values supported by `_.clone`. */ +var cloneableTags = {}; +cloneableTags[argsTag] = cloneableTags[arrayTag] = +cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = +cloneableTags[boolTag] = cloneableTags[dateTag] = +cloneableTags[float32Tag] = cloneableTags[float64Tag] = +cloneableTags[int8Tag] = cloneableTags[int16Tag] = +cloneableTags[int32Tag] = cloneableTags[mapTag] = +cloneableTags[numberTag] = cloneableTags[objectTag] = +cloneableTags[regexpTag] = cloneableTags[setTag] = +cloneableTags[stringTag] = cloneableTags[symbolTag] = +cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = +cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; +cloneableTags[errorTag] = cloneableTags[funcTag] = +cloneableTags[weakMapTag] = false; - if (BSD_SOURCE_CODE_LICENSE.test(str)) { - // https://spdx.org/licenses/BSD-Source-Code.html - return 'BSD-Source-Code*'; - } +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; - if (WTFPL_LICENSE.test(str)) { - return 'WTFPL*'; - } +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; - if (ISC.test(str)) { - return 'ISC*'; - } +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); - if (MIT.test(str)) { - return 'MIT*'; - } +/** Detect free variable `exports`. */ +var freeExports = true && exports && !exports.nodeType && exports; - if (BSD.test(str)) { - return 'BSD*'; - } +/** Detect free variable `module`. */ +var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; - if (WTFPL.test(str)) { - return 'WTFPL*'; - } +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; - if (APACHE_VERSION.test(str)) { - match = APACHE_VERSION.exec(str); - version = match[1]; +/** + * Adds the key-value `pair` to `map`. + * + * @private + * @param {Object} map The map to modify. + * @param {Array} pair The key-value pair to add. + * @returns {Object} Returns `map`. + */ +function addMapEntry(map, pair) { + // Don't return `map.set` because it's not chainable in IE 11. + map.set(pair[0], pair[1]); + return map; +} - if (version.length === 1) { - version = version + '.0'; - } +/** + * Adds `value` to `set`. + * + * @private + * @param {Object} set The set to modify. + * @param {*} value The value to add. + * @returns {Object} Returns `set`. + */ +function addSetEntry(set, value) { + // Don't return `set.add` because it's not chainable in IE 11. + set.add(value); + return set; +} - return 'Apache-' + version + '*'; - } +/** + * A specialized version of `_.forEach` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ +function arrayEach(array, iteratee) { + var index = -1, + length = array ? array.length : 0; - if (APACHE.test(str)) { - return 'Apache*'; + while (++index < length) { + if (iteratee(array[index], index, array) === false) { + break; } + } + return array; +} - if (APACHE_VERSION_SHORT.test(str)) { - match = APACHE_VERSION_SHORT.exec(str); - version = match[1]; - - if (version.length === 1) { - version = version + '.0'; - } +/** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ +function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; - return 'Apache-' + version + '*'; - } + while (++index < length) { + array[offset + index] = values[index]; + } + return array; +} - if (CC0_1_0.test(str)) { - return 'CC0-1.0*'; - } +/** + * A specialized version of `_.reduce` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the first element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. + */ +function arrayReduce(array, iteratee, accumulator, initAccum) { + var index = -1, + length = array ? array.length : 0; - if (GPL.test(str)) { - match = GPL.exec(str); - version = match[1]; - - /*istanbul ignore else*/ - if (version.length === 1) { - version = version + '.0'; - } + if (initAccum && length) { + accumulator = array[++index]; + } + while (++index < length) { + accumulator = iteratee(accumulator, array[index], index, array); + } + return accumulator; +} - return 'GPL-' + version + '*'; - } +/** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ +function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); - if (LGPL.test(str)) { - match = LGPL.exec(str); - version = match[1]; + while (++index < n) { + result[index] = iteratee(index); + } + return result; +} - if (version.length === 1) { - version = version + '.0'; - } - return 'LGPL-' + version + '*'; - } +/** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function getValue(object, key) { + return object == null ? undefined : object[key]; +} - if (PUBLIC_DOMAIN.test(str)) { - return 'Public Domain'; - } +/** + * Checks if `value` is a host object in IE < 9. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a host object, else `false`. + */ +function isHostObject(value) { + // Many host objects are `Object` objects that can coerce to strings + // despite having improperly defined `toString` methods. + var result = false; + if (value != null && typeof value.toString != 'function') { + try { + result = !!(value + ''); + } catch (e) {} + } + return result; +} - if (UNLICENSED.test(str)) { - return 'UNLICENSED'; - } +/** + * Converts `map` to its key-value pairs. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. + */ +function mapToArray(map) { + var index = -1, + result = Array(map.size); - match = IS_URL.exec(str) || IS_FILE_REFERENCE.exec(str); + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; +} - if (match) { - const matchedUrl = match[1]; - CONTAINS_LICENSE_TERM.lastIndex = 0; - CONTAINS_URLS_ENDING_WITH.lastIndex = 0; +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; +} - if (CONTAINS_LICENSE_TERM.test(str) && !CONTAINS_URLS_ENDING_WITH.test(matchedUrl)) { - return `Custom: ${matchedUrl}`; - } - } +/** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ +function setToArray(set) { + var index = -1, + result = Array(set.size); - return null; -}; + set.forEach(function(value) { + result[++index] = value; + }); + return result; +} +/** Used for built-in method references. */ +var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; -/***/ }), +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; -/***/ 5344: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/** Used to detect methods masquerading as native. */ +var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; +}()); -/* -Copyright (c) 2013, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://yuilibrary.com/license/ -*/ +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; -const LICENSE_TITLE_UNKNOWN = 'UNKNOWN'; -const LICENSE_TITLE_UNLICENSED = 'UNLICENSED'; -const INITIAL_MODULE_INFO = { - licenses: LICENSE_TITLE_UNKNOWN, -}; +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; -const chalk = __nccwpck_require__(8818); -const debug = __nccwpck_require__(8237); -const fs = __nccwpck_require__(7561); -const mkdirp = __nccwpck_require__(6186); -const path = __nccwpck_require__(9411); -const readInstalledPackages = __nccwpck_require__(2057); -const spdxCorrect = __nccwpck_require__(2372); -const spdxSatisfies = __nccwpck_require__(4424); -const treeify = __nccwpck_require__(355); -const createHash = (__nccwpck_require__(6113).createHash); - -const getLicenseTitle = __nccwpck_require__(8423); -const licenseFiles = __nccwpck_require__(885); -const helpers = __nccwpck_require__(53); +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; -// Set up debug logging -// https://www.npmjs.com/package/debug#stderr-vs-stdout -const debugError = debug('license-checker-rseidelsohn:error'); -const debugLog = debug('license-checker-rseidelsohn:log'); +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); -debugLog.log = console.log.bind(console); +/** Built-in value references. */ +var Buffer = moduleExports ? root.Buffer : undefined, + Symbol = root.Symbol, + Uint8Array = root.Uint8Array, + getPrototype = overArg(Object.getPrototypeOf, Object), + objectCreate = Object.create, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + splice = arrayProto.splice; -// This function calls itself recursively. On the first iteration, it collects the data of the main program, during the -// second iteration, it collects the data from all direct dependencies, then it collects their dependencies and so on. -const recursivelyCollectAllDependencies = (options) => { - const { color: colorize, deps: currentExtendedPackageJson, unknown } = options; - const moduleInfo = { ...INITIAL_MODULE_INFO }; - const currentPackageNameAndVersion = `${currentExtendedPackageJson.name}@${currentExtendedPackageJson.version}`; +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeGetSymbols = Object.getOwnPropertySymbols, + nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, + nativeKeys = overArg(Object.keys, Object); - let { data } = options; - let licenseFilesInCurrentModuleDirectory = []; - let licenseData; - let licenseFile; - let noticeFiles = []; - let clarification = options.clarifications?.[currentPackageNameAndVersion]; - let passedClarificationCheck = clarification?.checksum ? false : true; +/* Built-in method references that are verified to be native. */ +var DataView = getNative(root, 'DataView'), + Map = getNative(root, 'Map'), + Promise = getNative(root, 'Promise'), + Set = getNative(root, 'Set'), + WeakMap = getNative(root, 'WeakMap'), + nativeCreate = getNative(Object, 'create'); - if ( - // If we have processed this currentPackageNameAndVersion already, just return the data object. - // This was added so that we don't recurse forever if there was a circular - // dependency in the dependency tree. - data[currentPackageNameAndVersion] || - (options.production && currentExtendedPackageJson.extraneous) || - (options.development && !currentExtendedPackageJson.extraneous && !currentExtendedPackageJson.root) - ) { - return data; - } +/** Used to detect maps, sets, and weakmaps. */ +var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); - if (currentExtendedPackageJson.private) { - moduleInfo.private = true; - } +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; - data[currentPackageNameAndVersion] = moduleInfo; +/** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Hash(entries) { + var index = -1, + length = entries ? entries.length : 0; - // Include property in output unless custom format has set property explicitly to false: - const mustInclude = (propertyName = '') => options?.customFormat?.[propertyName] !== false; + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} - if (mustInclude('repository')) { - const repositoryUrl = helpers.getRepositoryUrl({ - clarificationRepository: clarification?.repository, - jsonRepository: currentExtendedPackageJson?.repository, - }); +/** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ +function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; +} - if (repositoryUrl) { - moduleInfo.repository = repositoryUrl; - } - } +/** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function hashDelete(key) { + return this.has(key) && delete this.__data__[key]; +} - if (mustInclude('url')) { - // TODO: Figure out where the check for currentExtendedPackageJson.url.web comes from. It's in the original license-checker, - // but I can't find any documentation on it. - let url = helpers.getFirstNotUndefinedOrUndefined(clarification?.url, currentExtendedPackageJson?.url?.web); - /*istanbul ignore next*/ - if (url) { - moduleInfo.url = url; - } - } +/** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; +} - if (typeof currentExtendedPackageJson.author === 'object') { - const { publisher, email, url } = helpers.getAuthorDetails({ - clarification, - author: currentExtendedPackageJson?.author, - }); +/** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function hashHas(key) { + var data = this.__data__; + return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); +} - if (mustInclude('publisher') && publisher) { - moduleInfo.publisher = publisher; - } +/** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ +function hashSet(key, value) { + var data = this.__data__; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; +} - if (mustInclude('email') && email) { - moduleInfo.email = email; - } +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; - // moduleInfo.url can for some reason already be set to currentExtendedPackageJson.url.web further up in the code, - // so we only set it if it's not already set. - if (typeof moduleInfo.url !== 'undefined' && mustInclude('url') && url) { - moduleInfo.url = url; - } - } +/** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function ListCache(entries) { + var index = -1, + length = entries ? entries.length : 0; - /*istanbul ignore next*/ - if (unknown) { - moduleInfo.dependencyPath = currentExtendedPackageJson.path; - } + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} - const modulePath = helpers.getFirstNotUndefinedOrUndefined(clarification?.path, currentExtendedPackageJson?.path); - if (mustInclude('path') && typeof modulePath === 'string') { - moduleInfo.path = modulePath; - } +/** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ +function listCacheClear() { + this.__data__ = []; +} - // Eventually store the contents of the module's README.md in currentExtendedPackageJson.readme: - helpers.storeReadmeInJsonIfExists(modulePath, currentExtendedPackageJson); +/** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); - // console.log('licenseData: %s', licenseData); + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + return true; +} - // Try to get the license information from the clarification file or from the package.json file: - licenseData = helpers.getFirstNotUndefinedOrUndefined( - clarification?.licenses, - currentExtendedPackageJson.license, - currentExtendedPackageJson.licenses, - ); +/** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); - if (licenseData) { - // License information has been collected from either the clarifiation file or from the package.json file - /*istanbul ignore else*/ - if (Array.isArray(licenseData) && licenseData.length > 0) { - moduleInfo.licenses = licenseData.map((moduleLicense) => { - const moduleLicenseTypeOrName = helpers.getFirstNotUndefinedOrUndefined( - moduleLicense.type, - moduleLicense.name, - ); + return index < 0 ? undefined : data[index][1]; +} - if (typeof moduleLicenseTypeOrName === 'string') { - return moduleLicenseTypeOrName; - } +/** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; +} - if (typeof moduleLicense === 'string') { - return moduleLicense; - } - }); - } else if (typeof helpers.getFirstNotUndefinedOrUndefined(licenseData.type, licenseData.name) === 'string') { - moduleInfo.licenses = getLicenseTitle( - helpers.getFirstNotUndefinedOrUndefined(licenseData.type, licenseData.name), - ); - } else if (typeof licenseData === 'string') { - moduleInfo.licenses = getLicenseTitle(licenseData); - } - } else if (getLicenseTitle(currentExtendedPackageJson.readme)) { - // Try to get the license information from the README file if neither the clarification file nor the package.json - // file contained any license information: - moduleInfo.licenses = getLicenseTitle(currentExtendedPackageJson.readme); - } +/** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ +function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); - if (Array.isArray(moduleInfo.licenses)) { - /*istanbul ignore else*/ - if (moduleInfo.licenses.length === 1) { - moduleInfo.licenses = moduleInfo.licenses[0]; - } - } + if (index < 0) { + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; +} - /*istanbul ignore else*/ - if (clarification?.licenseFile) { - licenseFilesInCurrentModuleDirectory = [clarification.licenseFile]; - } else if (fs.existsSync(modulePath)) { - const filesInModuleDirectory = fs.readdirSync(modulePath); - licenseFilesInCurrentModuleDirectory = licenseFiles(filesInModuleDirectory); +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; - noticeFiles = filesInModuleDirectory.filter((filename) => { - filename = filename.toUpperCase(); - const name = path.basename(filename).replace(path.extname(filename), ''); +/** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function MapCache(entries) { + var index = -1, + length = entries ? entries.length : 0; - return name === 'NOTICE'; - }); - } - - // console.log('licenseFilesInCurrentModuleDirectory before: %s', licenseFilesInCurrentModuleDirectory); - - licenseFilesInCurrentModuleDirectory.forEach(function findBetterLicenseData(filename, index) { - licenseFile = path.join(modulePath, filename); - // Checking that the file is in fact a normal file and not a directory for example. - /*istanbul ignore else*/ - if (fs.lstatSync(licenseFile).isFile()) { - let currentLicenceFilesContent; - - if ( - !moduleInfo.licenses || - moduleInfo.licenses.indexOf(LICENSE_TITLE_UNKNOWN) > -1 - // TODO: Should we override a custom license? - // || moduleInfo.licenses.indexOf('Custom:') === 0 - ) { - //Only re-check the license if we didn't get it from elsewhere - currentLicenceFilesContent = fs.readFileSync(licenseFile, { encoding: 'utf8' }); - - moduleInfo.licenses = getLicenseTitle(currentLicenceFilesContent); - } - - if (index === 0) { - // Treat the file with the highest precedence as licenseFile - if (clarification !== undefined && !passedClarificationCheck) { - /*istanbul ignore else*/ - if (!currentLicenceFilesContent) { - currentLicenceFilesContent = fs.readFileSync(licenseFile, { encoding: 'utf8' }); - } - - let sha256 = createHash('sha256').update(currentLicenceFilesContent).digest('hex'); - - if (clarification.checksum !== sha256) { - console.error( - `Clarification checksum mismatch for ${currentPackageNameAndVersion} :(\nFile checked: ${licenseFile}`, - ); - process.exit(1); - } else { - passedClarificationCheck = true; - } - } + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} - /*istanbul ignore else*/ - if (mustInclude('licenseFile')) { - moduleInfo.licenseFile = helpers.getFirstNotUndefinedOrUndefined( - clarification?.licenseFile, - options.basePath ? path.relative(options.basePath, licenseFile) : licenseFile, - ); - } +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapCacheClear() { + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; +} - if (mustInclude('licenseText') && options.customFormat) { - if (clarification?.licenseText) { - moduleInfo.licenseText = clarification.licenseText; - } else { - if (!currentLicenceFilesContent) { - currentLicenceFilesContent = fs.readFileSync(licenseFile, { encoding: 'utf8' }); - } +/** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function mapCacheDelete(key) { + return getMapData(this, key)['delete'](key); +} - /*istanbul ignore else*/ - if (options._args && !options._args.csv) { - moduleInfo.licenseText = currentLicenceFilesContent.trim(); - } else { - moduleInfo.licenseText = currentLicenceFilesContent - .replace(/"/g, "'") - .replace(/\r?\n|\r/g, ' ') - .trim(); - } - } +/** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function mapCacheGet(key) { + return getMapData(this, key).get(key); +} - if (clarification?.licenseStart) { - let startIndex = moduleInfo.licenseText.indexOf(clarification.licenseStart); - let endIndex; +/** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function mapCacheHas(key) { + return getMapData(this, key).has(key); +} - if (clarification?.licenseEnd) { - endIndex = moduleInfo.licenseText.indexOf(clarification.licenseEnd, startIndex); - } else { - endIndex = moduleInfo.licenseText.length; - } +/** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ +function mapCacheSet(key, value) { + getMapData(this, key).set(key, value); + return this; +} - moduleInfo.licenseText = moduleInfo.licenseText.substring(startIndex, endIndex); - } - } +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; - if (mustInclude('copyright') && options.customFormat) { - if (clarification?.copyright) { - moduleInfo.copyright = clarification.copyright; - } else { - if (!currentLicenceFilesContent) { - currentLicenceFilesContent = fs.readFileSync(licenseFile, { encoding: 'utf8' }); - } +/** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Stack(entries) { + this.__data__ = new ListCache(entries); +} - const linesWithCopyright = helpers.getLinesWithCopyright(currentLicenceFilesContent); +/** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ +function stackClear() { + this.__data__ = new ListCache; +} - if (linesWithCopyright.length > 0) { - moduleInfo.copyright = linesWithCopyright[0].replace(/\n/g, '. ').trim(); - } +/** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function stackDelete(key) { + return this.__data__['delete'](key); +} - // Mark files with multiple copyright statements. This might be - // an indicator to take a closer look at the LICENSE file. - if (linesWithCopyright.length > 1) { - moduleInfo.copyright = `${moduleInfo.copyright}*`; - } - } - } - } - } - }); +/** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function stackGet(key) { + return this.__data__.get(key); +} - // console.log('moduleInfo.licenses after: %s', moduleInfo.licenses); +/** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function stackHas(key) { + return this.__data__.has(key); +} - if (!passedClarificationCheck) { - console.error('All clarifications must come with a checksum'); - process.exit(1); +/** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ +function stackSet(key, value) { + var cache = this.__data__; + if (cache instanceof ListCache) { + var pairs = cache.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + return this; } + cache = this.__data__ = new MapCache(pairs); + } + cache.set(key, value); + return this; +} - // TODO: How do clarifications interact with notice files? - noticeFiles.forEach((filename) => { - const file = path.join(currentExtendedPackageJson.path, filename); - /*istanbul ignore else*/ - if (fs.lstatSync(file).isFile()) { - moduleInfo.noticeFile = options.basePath ? path.relative(options.basePath, file) : file; - } - }); - - /*istanbul ignore else*/ - if (currentExtendedPackageJson.dependencies) { - Object.keys(currentExtendedPackageJson.dependencies).forEach((dependencyName) => { - const childDependency = - options.currentRecursionDepth > options._args.direct - ? {} - : currentExtendedPackageJson.dependencies[dependencyName]; - const dependencyId = `${childDependency.name}@${childDependency.version}`; - - if (data[dependencyId]) { - // already exists - return; - } +// Add methods to `Stack`. +Stack.prototype.clear = stackClear; +Stack.prototype['delete'] = stackDelete; +Stack.prototype.get = stackGet; +Stack.prototype.has = stackHas; +Stack.prototype.set = stackSet; - data = recursivelyCollectAllDependencies({ - _args: options._args, - basePath: options.basePath, - color: colorize, - customFormat: options.customFormat, - data, - deps: childDependency, - development: options.development, - production: options.production, - unknown, - currentRecursionDepth: options.currentRecursionDepth + 1, - clarifications: options.clarifications, - }); - }); - } +/** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ +function arrayLikeKeys(value, inherited) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + // Safari 9 makes `arguments.length` enumerable in strict mode. + var result = (isArray(value) || isArguments(value)) + ? baseTimes(value.length, String) + : []; - if (!currentExtendedPackageJson.name || !currentExtendedPackageJson.version) { - delete data[currentPackageNameAndVersion]; - } + var length = result.length, + skipIndexes = !!length; - /*istanbul ignore next*/ - if (options.customFormat) { - Object.keys(options.customFormat).forEach((customFormatKey) => { - if (mustInclude(customFormatKey) && moduleInfo[customFormatKey] === undefined) { - moduleInfo[customFormatKey] = helpers.getFirstNotUndefinedOrUndefined( - clarification?.[customFormatKey], - typeof currentExtendedPackageJson[customFormatKey] === 'string' - ? currentExtendedPackageJson[customFormatKey] - : options.customFormat[customFormatKey], - ); - } - }); + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && (key == 'length' || isIndex(key, length)))) { + result.push(key); } + } + return result; +} - return data; -}; - -exports.init = function init(args, callback) { - debugLog('scanning %s', args.start); +/** + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ +function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + object[key] = value; + } +} - // customPath is a path to a JSON file that defined a custom format - if (args.customPath) { - args.customFormat = exports.parseJson(args.customPath); +/** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; } + } + return -1; +} - const optionsForReadingInstalledPackages = { - depth: args.direct, // How deep to traverse the dependency tree - nopeer: args.nopeer, // Whether or not to skip peerDependencies in output - dev: true, // Whether or not to include devDependencies - log: debugLog, // A function to log debug info - }; +/** + * The base implementation of `_.assign` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ +function baseAssign(object, source) { + return object && copyObject(source, keys(source), object); +} - if (args.production || args.development) { - optionsForReadingInstalledPackages.dev = false; +/** + * The base implementation of `_.clone` and `_.cloneDeep` which tracks + * traversed objects. + * + * @private + * @param {*} value The value to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @param {boolean} [isFull] Specify a clone including symbols. + * @param {Function} [customizer] The function to customize cloning. + * @param {string} [key] The key of `value`. + * @param {Object} [object] The parent object of `value`. + * @param {Object} [stack] Tracks traversed objects and their clone counterparts. + * @returns {*} Returns the cloned value. + */ +function baseClone(value, isDeep, isFull, customizer, key, object, stack) { + var result; + if (customizer) { + result = object ? customizer(value, key, object, stack) : customizer(value); + } + if (result !== undefined) { + return result; + } + if (!isObject(value)) { + return value; + } + var isArr = isArray(value); + if (isArr) { + result = initCloneArray(value); + if (!isDeep) { + return copyArray(value, result); } + } else { + var tag = getTag(value), + isFunc = tag == funcTag || tag == genTag; - const toCheckforFailOn = []; - const toCheckforOnlyAllow = []; - let checker; - let pusher; - - if (args.onlyAllow) { - checker = args.onlyAllow; - pusher = toCheckforOnlyAllow; + if (isBuffer(value)) { + return cloneBuffer(value, isDeep); } - - if (args.failOn) { - checker = args.failOn; - pusher = toCheckforFailOn; + if (tag == objectTag || tag == argsTag || (isFunc && !object)) { + if (isHostObject(value)) { + return object ? value : {}; + } + result = initCloneObject(isFunc ? {} : value); + if (!isDeep) { + return copySymbols(value, baseAssign(result, value)); + } + } else { + if (!cloneableTags[tag]) { + return object ? value : {}; + } + result = initCloneByTag(value, tag, baseClone, isDeep); } + } + // Check for circular references and return its corresponding clone. + stack || (stack = new Stack); + var stacked = stack.get(value); + if (stacked) { + return stacked; + } + stack.set(value, result); - // An object mapping from Package name -> What contents it should have - let clarifications = {}; - if (args.clarificationsFile) { - clarifications = exports.parseJson(args.clarificationsFile); + if (!isArr) { + var props = isFull ? getAllKeys(value) : keys(value); + } + arrayEach(props || value, function(subValue, key) { + if (props) { + key = subValue; + subValue = value[key]; } + // Recursively populate clone (susceptible to call stack limits). + assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack)); + }); + return result; +} - if (checker && pusher) { - checker.split(';').forEach((license) => { - license = license.trim(); - /*istanbul ignore else*/ - if (license.length > 0) { - pusher.push(license); - } - }); - } +/** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} prototype The object to inherit from. + * @returns {Object} Returns the new object. + */ +function baseCreate(proto) { + return isObject(proto) ? objectCreate(proto) : {}; +} - readInstalledPackages(args.start, optionsForReadingInstalledPackages, (err, installedPackagesJson) => { - // Good to know: - // The json object returned by readInstalledPackages stores all direct (prod and dev) dependencies from - // the package.json file in the property '_dependencies'. The property 'dependencies' contains all dependencies, - // including the ones that are only required by other dependencies. - if (optionsForReadingInstalledPackages.depth === 0) { - helpers.deleteNonDirectDependenciesFromAllDependencies(installedPackagesJson, args); - } +/** + * The base implementation of `getAllKeys` and `getAllKeysIn` which uses + * `keysFunc` and `symbolsFunc` to get the enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Function} keysFunc The function to get the keys of `object`. + * @param {Function} symbolsFunc The function to get the symbols of `object`. + * @returns {Array} Returns the array of property names and symbols. + */ +function baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); +} - // 'allWantedDepthDependenciesWithVersions' might be longer than 'installedPackagesJson.dependencies', as it appends the version numbers to each key (package name), - // e.g. 'grunt@1' instead of 'grunt', and this way contains all different installed versions of each package: - let allWantedDepthDependenciesWithVersions = recursivelyCollectAllDependencies({ - _args: args, - basePath: args.relativeLicensePath ? installedPackagesJson.path : null, - color: args.color, - customFormat: args.customFormat, - data: {}, - deps: installedPackagesJson, - development: args.development, - production: args.production, - unknown: args.unknown, - currentRecursionDepth: 0, - clarifications, - }); +/** + * The base implementation of `getTag`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + return objectToString.call(value); +} - const colorize = args.color; - const sorted = {}; // 'sorted' will store the same items as allWantedDepthDependenciesWithVersions, but sorted by package name and version - let resultJson = {}; - const excludeLicenses = - args.excludeLicenses && - args.excludeLicenses - .match(/([^\\\][^,]|\\,)+/g) - .map((license) => license.replace(/\\,/g, ',').replace(/^\s+|\s+$/g, '')); - const includeLicenses = - args.includeLicenses && - args.includeLicenses - .match(/([^\\\][^,]|\\,)+/g) - .map((license) => license.replace(/\\,/g, ',').replace(/^\s+|\s+$/g, '')); - let inputError = null; +/** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ +function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); +} - const colorizeString = (string) => - /*istanbul ignore next*/ - colorize ? chalk.bold.red(string) : string; +/** + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; +} - const filterDeletePrivatePackages = (privatePackage) => { - /*istanbul ignore next - I don't have access to private packages to test */ - if (resultJson[privatePackage] && resultJson[privatePackage].private) { - delete resultJson[privatePackage]; - } - }; +/** + * Creates a clone of `buffer`. + * + * @private + * @param {Buffer} buffer The buffer to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Buffer} Returns the cloned buffer. + */ +function cloneBuffer(buffer, isDeep) { + if (isDeep) { + return buffer.slice(); + } + var result = new buffer.constructor(buffer.length); + buffer.copy(result); + return result; +} - const onlyIncludeWhitelist = (whitelist, filtered) => { - const resultJson = {}; +/** + * Creates a clone of `arrayBuffer`. + * + * @private + * @param {ArrayBuffer} arrayBuffer The array buffer to clone. + * @returns {ArrayBuffer} Returns the cloned array buffer. + */ +function cloneArrayBuffer(arrayBuffer) { + var result = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array(result).set(new Uint8Array(arrayBuffer)); + return result; +} - Object.keys(filtered).map((filteredPackage) => { - // Whitelist packages by declaring: - // 1. the package full name. Ex: `react` (we suffix an '@' to ensure we don't match packages like `react-native`) - // 2. the package full name and the major version. Ex: `react@16` - // 3. the package full name and full version. Ex: `react@16.0.2` - if ( - whitelist.findIndex((whitelistPackage) => - filteredPackage.startsWith( - whitelistPackage.lastIndexOf('@') > 0 ? whitelistPackage : `${whitelistPackage}@`, - ), - ) !== -1 - ) { - resultJson[filteredPackage] = filtered[filteredPackage]; - } - }); +/** + * Creates a clone of `dataView`. + * + * @private + * @param {Object} dataView The data view to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned data view. + */ +function cloneDataView(dataView, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; + return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); +} - return resultJson; - }; +/** + * Creates a clone of `map`. + * + * @private + * @param {Object} map The map to clone. + * @param {Function} cloneFunc The function to clone values. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned map. + */ +function cloneMap(map, isDeep, cloneFunc) { + var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map); + return arrayReduce(array, addMapEntry, new map.constructor); +} - const excludeBlacklist = (blacklist, filtered) => { - const resultJson = {}; +/** + * Creates a clone of `regexp`. + * + * @private + * @param {Object} regexp The regexp to clone. + * @returns {Object} Returns the cloned regexp. + */ +function cloneRegExp(regexp) { + var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); + result.lastIndex = regexp.lastIndex; + return result; +} - Object.keys(filtered).map((filteredPackage) => { - // Blacklist packages by declaring: - // 1. the package full name. Ex: `react` (we suffix an '@' to ensure we don't match packages like `react-native`) - // 2. the package full name and the major version. Ex: `react@16` - // 3. the package full name and full version. Ex: `react@16.0.2` - if ( - blacklist.findIndex((blacklistPackage) => - filteredPackage.startsWith( - blacklistPackage.lastIndexOf('@') > 0 ? blacklistPackage : `${blacklistPackage}@`, - ), - ) === -1 - ) { - resultJson[filteredPackage] = filtered[filteredPackage]; - } - }); +/** + * Creates a clone of `set`. + * + * @private + * @param {Object} set The set to clone. + * @param {Function} cloneFunc The function to clone values. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned set. + */ +function cloneSet(set, isDeep, cloneFunc) { + var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set); + return arrayReduce(array, addSetEntry, new set.constructor); +} - return resultJson; - }; +/** + * Creates a clone of the `symbol` object. + * + * @private + * @param {Object} symbol The symbol object to clone. + * @returns {Object} Returns the cloned symbol object. + */ +function cloneSymbol(symbol) { + return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; +} - const excludePackagesStartingWith = (blacklist, currentResult) => { - const resultJson = { ...currentResult }; +/** + * Creates a clone of `typedArray`. + * + * @private + * @param {Object} typedArray The typed array to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned typed array. + */ +function cloneTypedArray(typedArray, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; + return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); +} - for (const pkgName in resultJson) { - for (const denyPrefix of blacklist) { - if (pkgName.startsWith(denyPrefix)) delete resultJson[pkgName]; - } - } +/** + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ +function copyArray(source, array) { + var index = -1, + length = source.length; - return resultJson; - }; + array || (array = Array(length)); + while (++index < length) { + array[index] = source[index]; + } + return array; +} - const exitIfCheckHits = (packageName) => { - const currentLicense = resultJson[packageName]?.licenses; +/** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. + */ +function copyObject(source, props, object, customizer) { + object || (object = {}); - if (currentLicense) { - checkForFailOn(currentLicense); - checkForOnlyAllow(currentLicense, packageName); - } - }; + var index = -1, + length = props.length; - const checkForFailOn = (currentLicense) => { - if (!Array.isArray(toCheckforFailOn) || toCheckforFailOn.length === 0) { - return; - } + while (++index < length) { + var key = props[index]; - if (toCheckforFailOn.includes(currentLicense)) { - console.error(`Found license defined by the --failOn flag: "${currentLicense}". Exiting.`); + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : undefined; - process.exit(1); - } - }; + assignValue(object, key, newValue === undefined ? source[key] : newValue); + } + return object; +} - /** - * Check if the current license contains (eventually among others) at least one of the allowed licenses - * - * @param {string} currentLicense The current license - * @param {string} packageName The package name - */ - const checkForOnlyAllow = (currentLicense, packageName) => { - if (toCheckforOnlyAllow.length > 0) { - let containsOneOfAllowedPackages = false; +/** + * Copies own symbol properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ +function copySymbols(source, object) { + return copyObject(source, getSymbols(source), object); +} - for (const allowedLicense of toCheckforOnlyAllow) { - // "currentLicense" is a longer string that may contain several license names, - // and we check if one of those is a license listed in the "toCheckforOnlyAllow" - // licenses array: - if (currentLicense.includes(allowedLicense)) { - containsOneOfAllowedPackages = true; - break; - } - } +/** + * Creates an array of own enumerable property names and symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ +function getAllKeys(object) { + return baseGetAllKeys(object, keys, getSymbols); +} - if (!containsOneOfAllowedPackages) { - console.error( - `Package "${packageName}" is licensed under "${currentLicense}" which is not permitted by the --onlyAllow flag. Exiting.`, - ); +/** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ +function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; +} - process.exit(1); - } - } - }; +/** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ +function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; +} - const transformBSD = (spdx) => - spdx === 'BSD' ? '(0BSD OR BSD-2-Clause OR BSD-3-Clause OR BSD-4-Clause)' : spdx; +/** + * Creates an array of the own enumerable symbol properties of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ +var getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray; - const invertResultOf = (fn) => (spdx) => !fn(spdx); +/** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +var getTag = baseGetTag; - const spdxIsValid = (spdx) => spdxCorrect(spdx) === spdx; +// Fallback for data views, maps, sets, and weak maps in IE 11, +// for data views in Edge < 14, and promises in Node.js. +if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function(value) { + var result = objectToString.call(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : undefined; - const getLicenseMatch = (licensesArr, filtered, packageName, packageData, compareLicenses) => { - const validSPDXLicenses = compareLicenses.map(transformBSD).filter(spdxIsValid); - const invalidSPDXLicenses = compareLicenses.map(transformBSD).filter(invertResultOf(spdxIsValid)); - const spdxExcluder = `( ${validSPDXLicenses.join(' OR ')} )`; + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: return dataViewTag; + case mapCtorString: return mapTag; + case promiseCtorString: return promiseTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; + } + } + return result; + }; +} - let match = false; +/** + * Initializes an array clone. + * + * @private + * @param {Array} array The array to clone. + * @returns {Array} Returns the initialized clone. + */ +function initCloneArray(array) { + var length = array.length, + result = array.constructor(length); - licensesArr.forEach((license) => { - /*istanbul ignore if - just for protection*/ - if (license.indexOf(LICENSE_TITLE_UNKNOWN) >= 0) { - // Necessary due to colorization: - filtered[packageName] = packageData; - } else { - if (license.endsWith('*')) { - license = license.slice(0, -1); - } + // Add properties assigned by `RegExp#exec`. + if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { + result.index = array.index; + result.input = array.input; + } + return result; +} - license = transformBSD(license); +/** + * Initializes an object clone. + * + * @private + * @param {Object} object The object to clone. + * @returns {Object} Returns the initialized clone. + */ +function initCloneObject(object) { + return (typeof object.constructor == 'function' && !isPrototype(object)) + ? baseCreate(getPrototype(object)) + : {}; +} - if ( - invalidSPDXLicenses.indexOf(license) >= 0 || - (spdxCorrect(license) && - validSPDXLicenses.length > 0 && - spdxSatisfies(spdxCorrect(license), spdxExcluder)) - ) { - match = true; - } - } - }); +/** + * Initializes an object clone based on its `toStringTag`. + * + * **Note:** This function only supports cloning values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to clone. + * @param {string} tag The `toStringTag` of the object to clone. + * @param {Function} cloneFunc The function to clone values. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the initialized clone. + */ +function initCloneByTag(object, tag, cloneFunc, isDeep) { + var Ctor = object.constructor; + switch (tag) { + case arrayBufferTag: + return cloneArrayBuffer(object); - return match; - }; + case boolTag: + case dateTag: + return new Ctor(+object); - // This following block stores the licenses in the sorted object (before, the sorted object is the empty object): - Object.keys(allWantedDepthDependenciesWithVersions) - .sort() - .forEach((item) => { - if (allWantedDepthDependenciesWithVersions[item].private) { - allWantedDepthDependenciesWithVersions[item].licenses = colorizeString(LICENSE_TITLE_UNLICENSED); - } + case dataViewTag: + return cloneDataView(object, isDeep); - /*istanbul ignore next*/ - if (!allWantedDepthDependenciesWithVersions[item].licenses) { - allWantedDepthDependenciesWithVersions[item].licenses = colorizeString(LICENSE_TITLE_UNKNOWN); - } + case float32Tag: case float64Tag: + case int8Tag: case int16Tag: case int32Tag: + case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: + return cloneTypedArray(object, isDeep); - if ( - args.unknown && - allWantedDepthDependenciesWithVersions[item].licenses && - allWantedDepthDependenciesWithVersions[item].licenses !== LICENSE_TITLE_UNKNOWN && - allWantedDepthDependenciesWithVersions[item].licenses.indexOf('*') > -1 - ) { - /*istanbul ignore if*/ - allWantedDepthDependenciesWithVersions[item].licenses = colorizeString(LICENSE_TITLE_UNKNOWN); - } - /*istanbul ignore else*/ - if (allWantedDepthDependenciesWithVersions[item]) { - if (args.relativeModulePath && allWantedDepthDependenciesWithVersions[item].path != null) { - allWantedDepthDependenciesWithVersions[item].path = path.relative( - args.start, - allWantedDepthDependenciesWithVersions[item].path, - ); - } + case mapTag: + return cloneMap(object, isDeep, cloneFunc); - if (args.onlyunknown) { - if ( - allWantedDepthDependenciesWithVersions[item].licenses.indexOf('*') > -1 || - allWantedDepthDependenciesWithVersions[item].licenses.indexOf(LICENSE_TITLE_UNKNOWN) > -1 - ) { - sorted[item] = allWantedDepthDependenciesWithVersions[item]; - } - } else { - sorted[item] = allWantedDepthDependenciesWithVersions[item]; - } - } - }); - - // 'allWantedDepthDependenciesWithVersions' is not needed anymore: - allWantedDepthDependenciesWithVersions = null; - - if (!Object.keys(sorted).length) { - err = new Error('No packages found in this path...'); - } - - // This following block stores the entries from the 'sorted' object in the - // resultJson object (before, the resultJson object is the empty object): - if ( - (!Array.isArray(excludeLicenses) || excludeLicenses.length === 0) && - (!Array.isArray(includeLicenses) || includeLicenses.length === 0) - ) { - resultJson = { ...sorted }; - } else { - if (Array.isArray(excludeLicenses) && excludeLicenses.length > 0) { - Object.entries(sorted).forEach(([packageName, packageData]) => { - let { licenses } = packageData; - - /*istanbul ignore if - just for protection*/ - if (!licenses) { - resultJson[packageName] = packageData; - } else { - const licensesArr = Array.isArray(licenses) ? licenses : [licenses]; - const licenseMatch = getLicenseMatch( - licensesArr, - resultJson, - packageName, - packageData, - excludeLicenses, - ); - - if (!licenseMatch) { - resultJson[packageName] = packageData; - } - } - }); - } - - if (Array.isArray(includeLicenses) && includeLicenses.length > 0) { - Object.entries(sorted).forEach(([packageName, packageData]) => { - let { licenses } = packageData; - - /*istanbul ignore if - just for protection*/ - if (!licenses) { - resultJson[packageName] = packageData; - } else { - const licensesArr = Array.isArray(licenses) ? licenses : [licenses]; - const licenseMatch = getLicenseMatch( - licensesArr, - resultJson, - packageName, - packageData, - includeLicenses, - ); - - if (licenseMatch) { - resultJson[packageName] = packageData; - } - } - }); - } - } - - // package whitelist - const whitelist = helpers.getOptionArray(args.includePackages); - if (whitelist) { - resultJson = onlyIncludeWhitelist(whitelist, resultJson); - } - - // package blacklist - const blacklist = helpers.getOptionArray(args.excludePackages); - if (blacklist) { - resultJson = excludeBlacklist(blacklist, resultJson); - } - - // exclude by package name starting with a string - const excludeStartStringsArr = helpers.getOptionArray(args.excludePackagesStartingWith); - if (excludeStartStringsArr) { - resultJson = excludePackagesStartingWith(excludeStartStringsArr, resultJson); - } - - if (args.excludePrivatePackages) { - Object.keys(resultJson).forEach(filterDeletePrivatePackages); - } - - Object.keys(resultJson).forEach(exitIfCheckHits); - - /*istanbul ignore next*/ - if (err) { - debugError(err); - inputError = err; - } else { - // Output to files, if necessary - exports.writeOutput(args, resultJson); - } - - // Return the callback and variables nicely - callback(inputError, resultJson); - }); -}; - -exports.filterAttributes = (attributes, json) => { - let filteredJson = json; - - if (attributes) { - filteredJson = {}; - attributes.forEach((attribute) => { - filteredJson[attribute] = json[attribute]; - }); - } - - return filteredJson; -}; - -exports.print = (sorted) => { - console.log(exports.asTree(sorted)); -}; - -exports.asTree = (sorted) => treeify.asTree(sorted, true); - -exports.asSummary = (sorted) => { - const licenseCountMap = new global.Map(); - const licenseCountArray = []; - const sortedLicenseCountObj = {}; - - Object.values(sorted).forEach(({ licenses }) => { - /*istanbul ignore else*/ - if (licenses) { - licenseCountMap.set(licenses, licenseCountMap.get(licenses) + 1 || 1); - } - }); - - licenseCountMap.forEach((count, license) => { - licenseCountArray.push({ license, count }); - }); - - /*istanbul ignore next*/ - licenseCountArray - .sort((a, b) => b.count - a.count) - .forEach(({ license, count }) => { - sortedLicenseCountObj[license] = count; - }); + case numberTag: + case stringTag: + return new Ctor(object); - return treeify.asTree(sortedLicenseCountObj, true); -}; + case regexpTag: + return cloneRegExp(object); -exports.asCSV = (sorted, customFormat, csvComponentPrefix) => { - const csvHeaders = helpers.getCsvHeaders(customFormat, csvComponentPrefix); - const csvDataArr = helpers.getCsvData(sorted, customFormat, csvComponentPrefix); + case setTag: + return cloneSet(object, isDeep, cloneFunc); - return [csvHeaders, ...csvDataArr].join('\n'); -}; + case symbolTag: + return cloneSymbol(object); + } +} /** - * Exports data as markdown (*.md) file which has it's own syntax. - * @method - * @param {JSON} sorted The sorted JSON data from all packages. - * @param {JSON} customFormat The custom format with information about the needed keys. - * @return {String} The returning plain text. + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. */ -exports.asMarkDown = (sorted, customFormat) => { - let text = []; - - if (customFormat && Object.keys(customFormat).length > 0) { - Object.keys(sorted).forEach((sortedItem) => { - text.push(`- **[${sortedItem}](${sorted[sortedItem].repository})**`); - - Object.keys(customFormat).forEach((customItem) => { - text.push(` - ${customItem}: ${sorted[sortedItem][customItem]}`); - }); - }); - } else { - Object.keys(sorted).forEach((key) => { - const module = sorted[key]; - text.push(`- [${key}](${module.repository}) - ${module.licenses}`); - }); - } - - return text.join('\n'); -}; +function isIndex(value, length) { + length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && + (typeof value == 'number' || reIsUint.test(value)) && + (value > -1 && value % 1 == 0 && value < length); +} /** - * Output data in plain vertical format like Angular CLI does: https://angular.io/3rdpartylicenses.txt + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. */ -exports.asPlainVertical = (sorted) => - Object.entries(sorted) - .map(([moduleName, moduleData]) => { - let licenseText = helpers.getModuleNameForLicenseTextHeader(moduleName); - - if (Array.isArray(moduleData.licenses) && moduleData.licenses.length > 0) { - licenseText += moduleData.licenses.map((moduleLicense) => { - /*istanbul ignore else*/ - if (typeof moduleLicense === 'object') { - /*istanbul ignore next*/ - return moduleLicense.type || moduleLicense.name; - } - - /*istanbul ignore next*/ - if (typeof moduleLicense === 'string') { - return moduleLicense; - } - }); - } else if ( - typeof moduleData.licenses === 'object' && - (moduleData.licenses.type || moduleData.licenses.name) - ) { - licenseText += getLicenseTitle(moduleData.licenses.type || moduleData.licenses.name); - } else if (typeof moduleData.licenses === 'string') { - licenseText += getLicenseTitle(moduleData.licenses); - } - - licenseText += '\n'; - - if (Array.isArray(moduleData.licenseFile) && moduleData.licenseFile.length > 0) { - licenseText += moduleData.licenseFile.map((moduleLicense) => { - /*istanbul ignore else*/ - if (typeof moduleLicense === 'object') { - /*istanbul ignore next*/ - return moduleLicense.type || moduleLicense.name; - } +function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); +} - if (typeof moduleLicense === 'string') { - return moduleLicense; - } - }); - } else if ( - typeof moduleData.licenseFile === 'object' && - (moduleData.licenseFile.type || moduleData.licenseFile.name) - ) { - licenseText += moduleData.licenseFile.type || moduleData.licenseFile.name; - } else if (typeof moduleData.licenseFile === 'string') { - licenseText += fs.readFileSync(moduleData.licenseFile, { encoding: 'utf8' }); - } +/** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); +} - return licenseText; - }) - .join('\n\n'); +/** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ +function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; -exports.parseJson = (jsonPath) => { - if (typeof jsonPath !== 'string') { - return new Error('The path was not specified for the JSON file to parse.'); - } + return value === proto; +} +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to process. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { try { - const jsonFileContents = fs.readFileSync(jsonPath, { encoding: 'utf8' }); - - return JSON.parse(jsonFileContents); - } catch (err) { - return err; - } -}; - -exports.asFiles = (json, outDir) => { - mkdirp.sync(outDir); - - Object.keys(json).forEach((moduleName) => { - const licenseFile = json[moduleName].licenseFile; - - if (licenseFile && fs.existsSync(licenseFile)) { - const fileContents = fs.readFileSync(licenseFile); - const outPath = path.join(outDir, `${moduleName}-LICENSE.txt`); - const baseDir = path.dirname(outPath); - - mkdirp.sync(baseDir); - fs.writeFileSync(outPath, fileContents, 'utf8'); - } else { - console.warn(`No license file found for module '${moduleName}'`); - } - }); -}; + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; +} /** - * Write output to a file, if indicated in parsedArgs. + * This method is like `_.clone` except that it recursively clones `value`. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Lang + * @param {*} value The value to recursively clone. + * @returns {*} Returns the deep cloned value. + * @see _.clone + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var deep = _.cloneDeep(objects); + * console.log(deep[0] === objects[0]); + * // => false */ -exports.writeOutput = function (parsedArgs, foundLicensesJson) { - if (parsedArgs.files || parsedArgs.out) { - // Import is in here to avoid a circular dependency - const licenseCheckerHelpers = __nccwpck_require__(2871); - - const formattedOutput = licenseCheckerHelpers.getFormattedOutput(foundLicensesJson, parsedArgs); - - if (parsedArgs.files) { - exports.asFiles(foundLicensesJson, parsedArgs.files); - } - - if (parsedArgs.out) { - const dir = path.dirname(parsedArgs.out); +function cloneDeep(value) { + return baseClone(value, true, true); +} - mkdirp.sync(dir); - fs.writeFileSync(parsedArgs.out, formattedOutput, 'utf8'); - } - } -}; +/** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} +/** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ +function isArguments(value) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && + (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); +} -/***/ }), +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray = Array.isArray; -/***/ 53: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ +function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); +} -const fs = __nccwpck_require__(7561); -const path = __nccwpck_require__(9411); +/** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ +function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); +} /** - * ! This function has a wanted sideeffect, as it modifies the json object that is passed by reference. + * Checks if `value` is a buffer. * - * The depth attribute set in the options parameter here - which is defined by setting the `--direct` flag - is of - * no use with npm < 3, as the older npm versions flattened all dependencies into one single directory. So in - * order to making `--direct` work with older versions of npm, we need to filter out all non-dependencies from - * the json result. + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false */ -// TODO: Add tests for this function -const deleteNonDirectDependenciesFromAllDependencies = function deleteNonDirectDependenciesFromAllDependencies( - { _dependencies: directDependencies = {}, dependencies: allDependencies = {}, devDependencies = {} } = {}, - options, -) { - const allDependenciesArray = Object.keys(allDependencies); - const directDependenciesArray = Object.keys(directDependencies); - const devDependenciesArray = Object.keys(devDependencies); - let wantedDependenciesArray = []; +var isBuffer = nativeIsBuffer || stubFalse; - if (options.production && !options.development) { - wantedDependenciesArray = directDependenciesArray.filter( - (directDependency) => !devDependenciesArray.includes(directDependency), - ); - } else if (!options.production && options.development) { - wantedDependenciesArray = devDependenciesArray; - } else { - wantedDependenciesArray = directDependenciesArray; - } - - allDependenciesArray.forEach((currentDependency) => { - if (!wantedDependenciesArray.includes(currentDependency)) { - delete allDependencies[currentDependency]; - } - }); -}; - -const getRepositoryUrl = function getRepositoryUrl({ clarificationRepository, jsonRepository }) { - if (clarificationRepository) { - return clarificationRepository; - } - - if (typeof jsonRepository?.url === 'string') { - return jsonRepository.url - .replace('git+ssh://git@', 'git://') - .replace('git+https://github.com', 'https://github.com') - .replace('git://github.com', 'https://github.com') - .replace('git@github.com:', 'https://github.com/') - .replace(/\.git$/, ''); - } - - return undefined; -}; +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8-9 which returns 'object' for typed array and other constructors. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; +} -const getFirstNotUndefinedOrUndefined = function getFirstNotUndefinedOrUndefined() { - for (let i = 0; i < arguments.length; i++) { - if (typeof arguments[i] !== 'undefined') { - return arguments[i]; - } - } +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ +function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} - return undefined; -}; +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} -const getAuthorDetails = function getAuthorDetails({ clarification, author }) { - let publisher = getFirstNotUndefinedOrUndefined(clarification?.publisher, author?.name); - let email = getFirstNotUndefinedOrUndefined(clarification?.email, author?.email); - let url = getFirstNotUndefinedOrUndefined(clarification?.url, author?.url); +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} - return { publisher, email, url }; -}; +/** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ +function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); +} -const getLinesWithCopyright = function getLinesWithCopyright(fileContents = '') { - return fileContents - .replace(/\r\n/g, '\n') - .split('\n\n') - .filter(function selectCopyRightStatements(value) { - return ( - value.startsWith('opyright', 1) && // include copyright statements - !value.startsWith('opyright notice', 1) && // exclude lines from from license text - !value.startsWith('opyright and related rights', 1) - ); - }) - .filter(function removeDuplicates(value, index, list) { - return index === 0 || value !== list[0]; - }); -}; +/** + * This method returns a new empty array. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {Array} Returns the new empty array. + * @example + * + * var arrays = _.times(2, _.stubArray); + * + * console.log(arrays); + * // => [[], []] + * + * console.log(arrays[0] === arrays[1]); + * // => false + */ +function stubArray() { + return []; +} -const getOptionArray = (option) => { - if (Array.isArray(option)) { - return option; - } +/** + * This method returns `false`. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {boolean} Returns `false`. + * @example + * + * _.times(2, _.stubFalse); + * // => [false, false] + */ +function stubFalse() { + return false; +} - if (typeof option === 'string') { - return option.split(';'); - } +module.exports = cloneDeep; - return false; -}; -const getCsvData = (sorted, customFormat, csvComponentPrefix) => { - const csvDataArr = []; +/***/ }), - Object.entries(sorted).forEach(([key, module]) => { - const dataElements = []; +/***/ 6186: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (csvComponentPrefix) { - dataElements.push(`"${csvComponentPrefix}"`); - } +const optsArg = __nccwpck_require__(2853) +const pathArg = __nccwpck_require__(2930) - // Grab the custom keys from the custom format - if (typeof customFormat === 'object' && Object.keys(customFormat).length > 0) { - dataElements.push(`"${key}"`); +const {mkdirpNative, mkdirpNativeSync} = __nccwpck_require__(4983) +const {mkdirpManual, mkdirpManualSync} = __nccwpck_require__(356) +const {useNative, useNativeSync} = __nccwpck_require__(4518) - Object.keys(customFormat).forEach((item) => { - dataElements.push(`"${module[item]}"`); - }); - } else { - // Be sure to push empty strings for empty values, as this is what CSV expects: - dataElements.push([`"${key}"`, `"${module.licenses || ''}"`, `"${module.repository || ''}"`]); - } - csvDataArr.push(dataElements.join(',')); - }); +const mkdirp = (path, opts) => { + path = pathArg(path) + opts = optsArg(opts) + return useNative(opts) + ? mkdirpNative(path, opts) + : mkdirpManual(path, opts) +} - return csvDataArr; -}; +const mkdirpSync = (path, opts) => { + path = pathArg(path) + opts = optsArg(opts) + return useNativeSync(opts) + ? mkdirpNativeSync(path, opts) + : mkdirpManualSync(path, opts) +} -const getCsvHeaders = (customFormat, csvComponentPrefix) => { - const prefixName = '"component"'; - const entriesArr = []; +mkdirp.sync = mkdirpSync +mkdirp.native = (path, opts) => mkdirpNative(pathArg(path), optsArg(opts)) +mkdirp.manual = (path, opts) => mkdirpManual(pathArg(path), optsArg(opts)) +mkdirp.nativeSync = (path, opts) => mkdirpNativeSync(pathArg(path), optsArg(opts)) +mkdirp.manualSync = (path, opts) => mkdirpManualSync(pathArg(path), optsArg(opts)) - if (csvComponentPrefix) { - entriesArr.push(prefixName); - } +module.exports = mkdirp - if (typeof customFormat === 'object' && Object.keys(customFormat).length > 0) { - entriesArr.push('"module name"'); - Object.keys(customFormat).forEach((item) => { - entriesArr.push(`"${item}"`); - }); - } else { - entriesArr.push('"module name"', '"license"', '"repository"'); - } +/***/ }), - return entriesArr.join(','); -}; +/***/ 4992: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const getModuleNameForLicenseTextHeader = (moduleName = '') => { - const lastIndexOfAtCharacter = moduleName.lastIndexOf('@'); +const {dirname} = __nccwpck_require__(1017) - return `${moduleName.substring(0, lastIndexOfAtCharacter)} ${moduleName.substring(lastIndexOfAtCharacter + 1)}\n`; -}; +const findMade = (opts, parent, path = undefined) => { + // we never want the 'made' return value to be a root directory + if (path === parent) + return Promise.resolve() -// Eventually store the contents of the module's README.md in currentExtendedPackageJson.readme: -const storeReadmeInJsonIfExists = (modulePath, currentExtendedPackageJson) => { - if ( - typeof modulePath !== 'string' || - typeof currentExtendedPackageJson !== 'object' || - modulePath === '' || - currentExtendedPackageJson?.readme?.toLowerCase()?.indexOf('no readme data found') === -1 - ) { - return; - } + return opts.statAsync(parent).then( + st => st.isDirectory() ? path : undefined, // will fail later + er => er.code === 'ENOENT' + ? findMade(opts, dirname(parent), parent) + : undefined + ) +} - const readmeFile = path.join(modulePath, 'README.md'); +const findMadeSync = (opts, parent, path = undefined) => { + if (path === parent) + return undefined - if (fs.existsSync(readmeFile)) { - currentExtendedPackageJson.readme = fs.readFileSync(readmeFile, 'utf8').toString(); - } -}; + try { + return opts.statSync(parent).isDirectory() ? path : undefined + } catch (er) { + return er.code === 'ENOENT' + ? findMadeSync(opts, dirname(parent), parent) + : undefined + } +} -module.exports = { - deleteNonDirectDependenciesFromAllDependencies, - getAuthorDetails, - getCsvData, - getCsvHeaders, - getFirstNotUndefinedOrUndefined, - getLinesWithCopyright, - getModuleNameForLicenseTextHeader, - getOptionArray, - getRepositoryUrl, - storeReadmeInJsonIfExists, -}; +module.exports = {findMade, findMadeSync} /***/ }), -/***/ 885: +/***/ 356: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const path = __nccwpck_require__(1017); +const {dirname} = __nccwpck_require__(1017) -const BASENAMES_PRECEDENCE = [ - /^LICENSE$/, - /^LICENSE\-\w+$/, // e.g. LICENSE-MIT - /^LICENCE$/, - /^LICENCE\-\w+$/, // e.g. LICENCE-MIT - /^MIT-LICENSE$/, - /^COPYING$/, - /^README$/, // TODO: should we really include README? -]; +const mkdirpManual = (path, opts, made) => { + opts.recursive = false + const parent = dirname(path) + if (parent === path) { + return opts.mkdirAsync(path, opts).catch(er => { + // swallowed by recursive implementation on posix systems + // any other error is a failure + if (er.code !== 'EISDIR') + throw er + }) + } -// Find and list license files in the precedence order -module.exports = function (dirFiles) { - const files = []; + return opts.mkdirAsync(path, opts).then(() => made || path, er => { + if (er.code === 'ENOENT') + return mkdirpManual(parent, opts) + .then(made => mkdirpManual(path, opts, made)) + if (er.code !== 'EEXIST' && er.code !== 'EROFS') + throw er + return opts.statAsync(path).then(st => { + if (st.isDirectory()) + return made + else + throw er + }, () => { throw er }) + }) +} - BASENAMES_PRECEDENCE.forEach((basenamePattern) => { - dirFiles.some((filename) => { - const basename = path.basename(filename, path.extname(filename)).toUpperCase(); +const mkdirpManualSync = (path, opts, made) => { + const parent = dirname(path) + opts.recursive = false - if (basenamePattern.test(basename)) { - files.push(filename); - return true; - } + if (parent === path) { + try { + return opts.mkdirSync(path, opts) + } catch (er) { + // swallowed by recursive implementation on posix systems + // any other error is a failure + if (er.code !== 'EISDIR') + throw er + else + return + } + } - return false; - }); - }); + try { + opts.mkdirSync(path, opts) + return made || path + } catch (er) { + if (er.code === 'ENOENT') + return mkdirpManualSync(path, opts, mkdirpManualSync(parent, opts, made)) + if (er.code !== 'EEXIST' && er.code !== 'EROFS') + throw er + try { + if (!opts.statSync(path).isDirectory()) + throw er + } catch (_) { + throw er + } + } +} - return files; -}; +module.exports = {mkdirpManual, mkdirpManualSync} /***/ }), -/***/ 2871: +/***/ 4983: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const chalk = __nccwpck_require__(8818); -const cloneDeep = __nccwpck_require__(2061); -const fs = __nccwpck_require__(7147); -const path = __nccwpck_require__(1017); - -const licenseChecker = __nccwpck_require__(5344); - -const shouldColorizeOutput = function shouldColorizeOutput(args) { - return args.color && !args.out && !args.files && !(args.csv || args.json || args.markdown || args.plainVertical); -}; +const {dirname} = __nccwpck_require__(1017) +const {findMade, findMadeSync} = __nccwpck_require__(4992) +const {mkdirpManual, mkdirpManualSync} = __nccwpck_require__(356) -const colorizeOutput = function colorizeOutput(json) { - Object.keys(json).forEach((key) => { - const index = key.lastIndexOf('@'); - const colorizedKey = - chalk.white.bgKeyword('darkslategrey')(key.slice(0, index + 1)) + - chalk.dim('@') + - chalk.white.bgKeyword('green')(key.slice(index + 1)); - json[colorizedKey] = json[key]; +const mkdirpNative = (path, opts) => { + opts.recursive = true + const parent = dirname(path) + if (parent === path) + return opts.mkdirAsync(path, opts) - delete json[key]; - }); -}; + return findMade(opts, path).then(made => + opts.mkdirAsync(path, opts).then(() => made) + .catch(er => { + if (er.code === 'ENOENT') + return mkdirpManual(path, opts) + else + throw er + })) +} -const filterJson = function filterJson(limitAttributes, json) { - let filteredJson = json; +const mkdirpNativeSync = (path, opts) => { + opts.recursive = true + const parent = dirname(path) + if (parent === path) + return opts.mkdirSync(path, opts) - if (limitAttributes) { - filteredJson = {}; - const attributes = limitAttributes.split(',').map((attribute) => attribute.trim()); + const made = findMadeSync(opts, path) + try { + opts.mkdirSync(path, opts) + return made + } catch (er) { + if (er.code === 'ENOENT') + return mkdirpManualSync(path, opts) + else + throw er + } +} - Object.keys(json).forEach((dependency) => { - filteredJson[dependency] = licenseChecker.filterAttributes(attributes, json[dependency]); - }); - } +module.exports = {mkdirpNative, mkdirpNativeSync} - return filteredJson; -}; -const getFormattedOutput = function getFormattedOutput(modulesWithVersions, args) { - let filteredJson = filterJson(args.limitAttributes, modulesWithVersions); - const jsonCopy = cloneDeep(filteredJson); - filteredJson = null; +/***/ }), - if (args.files) { - Object.keys(jsonCopy).forEach((moduleName) => { - const outPath = path.join(args.files, `${moduleName}-LICENSE.txt`); - const originalLicenseFile = jsonCopy[moduleName].licenseFile; +/***/ 2853: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (originalLicenseFile && fs.existsSync(originalLicenseFile)) { - if (args.relativeLicensePath) { - if (args.out) { - jsonCopy[moduleName].licenseFile = path.relative(path.dirname(args.out), outPath); - } else { - jsonCopy[moduleName].licenseFile = path.relative(process.cwd(), outPath); - } - } else { - jsonCopy[moduleName].licenseFile = outPath; - } - } - }); - } +const { promisify } = __nccwpck_require__(3837) +const fs = __nccwpck_require__(7147) +const optsArg = opts => { + if (!opts) + opts = { mode: 0o777, fs } + else if (typeof opts === 'object') + opts = { mode: 0o777, fs, ...opts } + else if (typeof opts === 'number') + opts = { mode: opts, fs } + else if (typeof opts === 'string') + opts = { mode: parseInt(opts, 8), fs } + else + throw new TypeError('invalid options argument') - if (args.json) { - return JSON.stringify(jsonCopy, null, 4) + '\n'; - } + opts.mkdir = opts.mkdir || opts.fs.mkdir || fs.mkdir + opts.mkdirAsync = promisify(opts.mkdir) + opts.stat = opts.stat || opts.fs.stat || fs.stat + opts.statAsync = promisify(opts.stat) + opts.statSync = opts.statSync || opts.fs.statSync || fs.statSync + opts.mkdirSync = opts.mkdirSync || opts.fs.mkdirSync || fs.mkdirSync + return opts +} +module.exports = optsArg - if (args.csv) { - return licenseChecker.asCSV(jsonCopy, args.customFormat, args.csvComponentPrefix); - } - if (args.markdown) { - return licenseChecker.asMarkDown(jsonCopy, args.customFormat) + '\n'; - } +/***/ }), - if (args.summary) { - return licenseChecker.asSummary(jsonCopy); - } +/***/ 2930: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (args.plainVertical || args.angluarCli) { - return licenseChecker.asPlainVertical(jsonCopy); - } +const platform = process.env.__TESTING_MKDIRP_PLATFORM__ || process.platform +const { resolve, parse } = __nccwpck_require__(1017) +const pathArg = path => { + if (/\0/.test(path)) { + // simulate same failure that node raises + throw Object.assign( + new TypeError('path must be a string without null bytes'), + { + path, + code: 'ERR_INVALID_ARG_VALUE', + } + ) + } - return licenseChecker.asTree(jsonCopy); -}; + path = resolve(path) + if (platform === 'win32') { + const badWinChars = /[*|"<>?:]/ + const {root} = parse(path) + if (badWinChars.test(path.substr(root.length))) { + throw Object.assign(new Error('Illegal characters in path.'), { + path, + code: 'EINVAL', + }) + } + } -module.exports = { - colorizeOutput: colorizeOutput, - getFormattedOutput: getFormattedOutput, - shouldColorizeOutput: shouldColorizeOutput, -}; + return path +} +module.exports = pathArg /***/ }), -/***/ 2061: -/***/ ((module, exports, __nccwpck_require__) => { +/***/ 4518: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/* module decorator */ module = __nccwpck_require__.nmd(module); -/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ +const fs = __nccwpck_require__(7147) -/** Used as the size to enable large array optimizations. */ -var LARGE_ARRAY_SIZE = 200; +const version = process.env.__TESTING_MKDIRP_NODE_VERSION__ || process.version +const versArr = version.replace(/^v/, '').split('.') +const hasNative = +versArr[0] > 10 || +versArr[0] === 10 && +versArr[1] >= 12 -/** Used to stand-in for `undefined` hash values. */ -var HASH_UNDEFINED = '__lodash_hash_undefined__'; +const useNative = !hasNative ? () => false : opts => opts.mkdir === fs.mkdir +const useNativeSync = !hasNative ? () => false : opts => opts.mkdirSync === fs.mkdirSync -/** Used as references for various `Number` constants. */ -var MAX_SAFE_INTEGER = 9007199254740991; +module.exports = {useNative, useNativeSync} -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - boolTag = '[object Boolean]', - dateTag = '[object Date]', - errorTag = '[object Error]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - mapTag = '[object Map]', - numberTag = '[object Number]', - objectTag = '[object Object]', - promiseTag = '[object Promise]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - symbolTag = '[object Symbol]', - weakMapTag = '[object WeakMap]'; -var arrayBufferTag = '[object ArrayBuffer]', - dataViewTag = '[object DataView]', - float32Tag = '[object Float32Array]', - float64Tag = '[object Float64Array]', - int8Tag = '[object Int8Array]', - int16Tag = '[object Int16Array]', - int32Tag = '[object Int32Array]', - uint8Tag = '[object Uint8Array]', - uint8ClampedTag = '[object Uint8ClampedArray]', - uint16Tag = '[object Uint16Array]', - uint32Tag = '[object Uint32Array]'; +/***/ }), + +/***/ 900: +/***/ ((module) => { /** - * Used to match `RegExp` - * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + * Helpers. */ -var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; - -/** Used to match `RegExp` flags from their coerced string values. */ -var reFlags = /\w*$/; - -/** Used to detect host constructors (Safari). */ -var reIsHostCtor = /^\[object .+?Constructor\]$/; - -/** Used to detect unsigned integer values. */ -var reIsUint = /^(?:0|[1-9]\d*)$/; - -/** Used to identify `toStringTag` values supported by `_.clone`. */ -var cloneableTags = {}; -cloneableTags[argsTag] = cloneableTags[arrayTag] = -cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = -cloneableTags[boolTag] = cloneableTags[dateTag] = -cloneableTags[float32Tag] = cloneableTags[float64Tag] = -cloneableTags[int8Tag] = cloneableTags[int16Tag] = -cloneableTags[int32Tag] = cloneableTags[mapTag] = -cloneableTags[numberTag] = cloneableTags[objectTag] = -cloneableTags[regexpTag] = cloneableTags[setTag] = -cloneableTags[stringTag] = cloneableTags[symbolTag] = -cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = -cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; -cloneableTags[errorTag] = cloneableTags[funcTag] = -cloneableTags[weakMapTag] = false; - -/** Detect free variable `global` from Node.js. */ -var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; - -/** Detect free variable `self`. */ -var freeSelf = typeof self == 'object' && self && self.Object === Object && self; - -/** Used as a reference to the global object. */ -var root = freeGlobal || freeSelf || Function('return this')(); - -/** Detect free variable `exports`. */ -var freeExports = true && exports && !exports.nodeType && exports; - -/** Detect free variable `module`. */ -var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; -/** Detect the popular CommonJS extension `module.exports`. */ -var moduleExports = freeModule && freeModule.exports === freeExports; +var s = 1000; +var m = s * 60; +var h = m * 60; +var d = h * 24; +var w = d * 7; +var y = d * 365.25; /** - * Adds the key-value `pair` to `map`. + * Parse or format the given `val`. * - * @private - * @param {Object} map The map to modify. - * @param {Array} pair The key-value pair to add. - * @returns {Object} Returns `map`. - */ -function addMapEntry(map, pair) { - // Don't return `map.set` because it's not chainable in IE 11. - map.set(pair[0], pair[1]); - return map; -} - -/** - * Adds `value` to `set`. + * Options: * - * @private - * @param {Object} set The set to modify. - * @param {*} value The value to add. - * @returns {Object} Returns `set`. - */ -function addSetEntry(set, value) { - // Don't return `set.add` because it's not chainable in IE 11. - set.add(value); - return set; -} - -/** - * A specialized version of `_.forEach` for arrays without support for - * iteratee shorthands. + * - `long` verbose formatting [false] * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns `array`. + * @param {String|Number} val + * @param {Object} [options] + * @throws {Error} throw an error if val is not a non-empty string or a number + * @return {String|Number} + * @api public */ -function arrayEach(array, iteratee) { - var index = -1, - length = array ? array.length : 0; - while (++index < length) { - if (iteratee(array[index], index, array) === false) { - break; - } +module.exports = function (val, options) { + options = options || {}; + var type = typeof val; + if (type === 'string' && val.length > 0) { + return parse(val); + } else if (type === 'number' && isFinite(val)) { + return options.long ? fmtLong(val) : fmtShort(val); } - return array; -} + throw new Error( + 'val is not a non-empty string or a valid number. val=' + + JSON.stringify(val) + ); +}; /** - * Appends the elements of `values` to `array`. + * Parse the given `str` and return milliseconds. * - * @private - * @param {Array} array The array to modify. - * @param {Array} values The values to append. - * @returns {Array} Returns `array`. + * @param {String} str + * @return {Number} + * @api private */ -function arrayPush(array, values) { - var index = -1, - length = values.length, - offset = array.length; - while (++index < length) { - array[offset + index] = values[index]; +function parse(str) { + str = String(str); + if (str.length > 100) { + return; + } + var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( + str + ); + if (!match) { + return; + } + var n = parseFloat(match[1]); + var type = (match[2] || 'ms').toLowerCase(); + switch (type) { + case 'years': + case 'year': + case 'yrs': + case 'yr': + case 'y': + return n * y; + case 'weeks': + case 'week': + case 'w': + return n * w; + case 'days': + case 'day': + case 'd': + return n * d; + case 'hours': + case 'hour': + case 'hrs': + case 'hr': + case 'h': + return n * h; + case 'minutes': + case 'minute': + case 'mins': + case 'min': + case 'm': + return n * m; + case 'seconds': + case 'second': + case 'secs': + case 'sec': + case 's': + return n * s; + case 'milliseconds': + case 'millisecond': + case 'msecs': + case 'msec': + case 'ms': + return n; + default: + return undefined; } - return array; } /** - * A specialized version of `_.reduce` for arrays without support for - * iteratee shorthands. + * Short format for `ms`. * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {boolean} [initAccum] Specify using the first element of `array` as - * the initial value. - * @returns {*} Returns the accumulated value. + * @param {Number} ms + * @return {String} + * @api private */ -function arrayReduce(array, iteratee, accumulator, initAccum) { - var index = -1, - length = array ? array.length : 0; - if (initAccum && length) { - accumulator = array[++index]; +function fmtShort(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return Math.round(ms / d) + 'd'; } - while (++index < length) { - accumulator = iteratee(accumulator, array[index], index, array); + if (msAbs >= h) { + return Math.round(ms / h) + 'h'; } - return accumulator; + if (msAbs >= m) { + return Math.round(ms / m) + 'm'; + } + if (msAbs >= s) { + return Math.round(ms / s) + 's'; + } + return ms + 'ms'; } /** - * The base implementation of `_.times` without support for iteratee shorthands - * or max array length checks. + * Long format for `ms`. * - * @private - * @param {number} n The number of times to invoke `iteratee`. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the array of results. + * @param {Number} ms + * @return {String} + * @api private */ -function baseTimes(n, iteratee) { - var index = -1, - result = Array(n); - while (++index < n) { - result[index] = iteratee(index); +function fmtLong(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return plural(ms, msAbs, d, 'day'); } - return result; + if (msAbs >= h) { + return plural(ms, msAbs, h, 'hour'); + } + if (msAbs >= m) { + return plural(ms, msAbs, m, 'minute'); + } + if (msAbs >= s) { + return plural(ms, msAbs, s, 'second'); + } + return ms + ' ms'; } /** - * Gets the value at `key` of `object`. - * - * @private - * @param {Object} [object] The object to query. - * @param {string} key The key of the property to get. - * @returns {*} Returns the property value. + * Pluralization helper. */ -function getValue(object, key) { - return object == null ? undefined : object[key]; -} -/** - * Checks if `value` is a host object in IE < 9. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a host object, else `false`. - */ -function isHostObject(value) { - // Many host objects are `Object` objects that can coerce to strings - // despite having improperly defined `toString` methods. - var result = false; - if (value != null && typeof value.toString != 'function') { - try { - result = !!(value + ''); - } catch (e) {} - } - return result; +function plural(ms, msAbs, n, name) { + var isPlural = msAbs >= n * 1.5; + return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); } -/** - * Converts `map` to its key-value pairs. - * - * @private - * @param {Object} map The map to convert. - * @returns {Array} Returns the key-value pairs. - */ -function mapToArray(map) { - var index = -1, - result = Array(map.size); - map.forEach(function(value, key) { - result[++index] = [key, value]; - }); - return result; -} +/***/ }), -/** - * Creates a unary function that invokes `func` with its argument transformed. - * - * @private - * @param {Function} func The function to wrap. - * @param {Function} transform The argument transform. - * @returns {Function} Returns the new function. - */ -function overArg(func, transform) { - return function(arg) { - return func(transform(arg)); - }; -} +/***/ 6976: +/***/ ((module) => { -/** - * Converts `set` to an array of its values. - * - * @private - * @param {Object} set The set to convert. - * @returns {Array} Returns the values. - */ -function setToArray(set) { - var index = -1, - result = Array(set.size); +module.exports = extractDescription - set.forEach(function(value) { - result[++index] = value; - }); - return result; +// Extracts description from contents of a readme file in markdown format +function extractDescription (d) { + if (!d) { + return + } + if (d === 'ERROR: No README data found!') { + return + } + // the first block of text before the first heading + // that isn't the first line heading + d = d.trim().split('\n') + let s = 0 + while (d[s] && d[s].trim().match(/^(#|$)/)) { + s++ + } + const l = d.length + let e = s + 1 + while (e < l && d[e].trim()) { + e++ + } + return d.slice(s, e).join(' ').trim() } -/** Used for built-in method references. */ -var arrayProto = Array.prototype, - funcProto = Function.prototype, - objectProto = Object.prototype; -/** Used to detect overreaching core-js shims. */ -var coreJsData = root['__core-js_shared__']; +/***/ }), -/** Used to detect methods masquerading as native. */ -var maskSrcKey = (function() { - var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); - return uid ? ('Symbol(src)_1.' + uid) : ''; -}()); +/***/ 3492: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** Used to resolve the decompiled source of functions. */ -var funcToString = funcProto.toString; +var isValidSemver = __nccwpck_require__(9601) +var cleanSemver = __nccwpck_require__(8848) +var validateLicense = __nccwpck_require__(2524) +var hostedGitInfo = __nccwpck_require__(167) +var isBuiltinModule = __nccwpck_require__(6873) +var depTypes = ['dependencies', 'devDependencies', 'optionalDependencies'] +var extractDescription = __nccwpck_require__(6976) +var url = __nccwpck_require__(7310) +var typos = __nccwpck_require__(1947) -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; +var isEmail = str => str.includes('@') && (str.indexOf('@') < str.lastIndexOf('.')) -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; +module.exports = { + // default warning function + warn: function () {}, -/** Used to detect if a method is native. */ -var reIsNative = RegExp('^' + - funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' -); + fixRepositoryField: function (data) { + if (data.repositories) { + this.warn('repositories') + data.repository = data.repositories[0] + } + if (!data.repository) { + return this.warn('missingRepository') + } + if (typeof data.repository === 'string') { + data.repository = { + type: 'git', + url: data.repository, + } + } + var r = data.repository.url || '' + if (r) { + var hosted = hostedGitInfo.fromUrl(r) + if (hosted) { + r = data.repository.url + = hosted.getDefaultRepresentation() === 'shortcut' ? hosted.https() : hosted.toString() + } + } -/** Built-in value references. */ -var Buffer = moduleExports ? root.Buffer : undefined, - Symbol = root.Symbol, - Uint8Array = root.Uint8Array, - getPrototype = overArg(Object.getPrototypeOf, Object), - objectCreate = Object.create, - propertyIsEnumerable = objectProto.propertyIsEnumerable, - splice = arrayProto.splice; + if (r.match(/github.com\/[^/]+\/[^/]+\.git\.git$/)) { + this.warn('brokenGitUrl', r) + } + }, -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeGetSymbols = Object.getOwnPropertySymbols, - nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, - nativeKeys = overArg(Object.keys, Object); + fixTypos: function (data) { + Object.keys(typos.topLevel).forEach(function (d) { + if (Object.prototype.hasOwnProperty.call(data, d)) { + this.warn('typo', d, typos.topLevel[d]) + } + }, this) + }, -/* Built-in method references that are verified to be native. */ -var DataView = getNative(root, 'DataView'), - Map = getNative(root, 'Map'), - Promise = getNative(root, 'Promise'), - Set = getNative(root, 'Set'), - WeakMap = getNative(root, 'WeakMap'), - nativeCreate = getNative(Object, 'create'); + fixScriptsField: function (data) { + if (!data.scripts) { + return + } + if (typeof data.scripts !== 'object') { + this.warn('nonObjectScripts') + delete data.scripts + return + } + Object.keys(data.scripts).forEach(function (k) { + if (typeof data.scripts[k] !== 'string') { + this.warn('nonStringScript') + delete data.scripts[k] + } else if (typos.script[k] && !data.scripts[typos.script[k]]) { + this.warn('typo', k, typos.script[k], 'scripts') + } + }, this) + }, -/** Used to detect maps, sets, and weakmaps. */ -var dataViewCtorString = toSource(DataView), - mapCtorString = toSource(Map), - promiseCtorString = toSource(Promise), - setCtorString = toSource(Set), - weakMapCtorString = toSource(WeakMap); + fixFilesField: function (data) { + var files = data.files + if (files && !Array.isArray(files)) { + this.warn('nonArrayFiles') + delete data.files + } else if (data.files) { + data.files = data.files.filter(function (file) { + if (!file || typeof file !== 'string') { + this.warn('invalidFilename', file) + return false + } else { + return true + } + }, this) + } + }, -/** Used to convert symbols to primitives and strings. */ -var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; + fixBinField: function (data) { + if (!data.bin) { + return + } + if (typeof data.bin === 'string') { + var b = {} + var match + if (match = data.name.match(/^@[^/]+[/](.*)$/)) { + b[match[1]] = data.bin + } else { + b[data.name] = data.bin + } + data.bin = b + } + }, -/** - * Creates a hash object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function Hash(entries) { - var index = -1, - length = entries ? entries.length : 0; + fixManField: function (data) { + if (!data.man) { + return + } + if (typeof data.man === 'string') { + data.man = [data.man] + } + }, + fixBundleDependenciesField: function (data) { + var bdd = 'bundledDependencies' + var bd = 'bundleDependencies' + if (data[bdd] && !data[bd]) { + data[bd] = data[bdd] + delete data[bdd] + } + if (data[bd] && !Array.isArray(data[bd])) { + this.warn('nonArrayBundleDependencies') + delete data[bd] + } else if (data[bd]) { + data[bd] = data[bd].filter(function (filtered) { + if (!filtered || typeof filtered !== 'string') { + this.warn('nonStringBundleDependency', filtered) + return false + } else { + if (!data.dependencies) { + data.dependencies = {} + } + if (!Object.prototype.hasOwnProperty.call(data.dependencies, filtered)) { + this.warn('nonDependencyBundleDependency', filtered) + data.dependencies[filtered] = '*' + } + return true + } + }, this) + } + }, - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} + fixDependencies: function (data, strict) { + objectifyDeps(data, this.warn) + addOptionalDepsToDeps(data, this.warn) + this.fixBundleDependenciesField(data) -/** - * Removes all key-value entries from the hash. - * - * @private - * @name clear - * @memberOf Hash - */ -function hashClear() { - this.__data__ = nativeCreate ? nativeCreate(null) : {}; -} + ;['dependencies', 'devDependencies'].forEach(function (deps) { + if (!(deps in data)) { + return + } + if (!data[deps] || typeof data[deps] !== 'object') { + this.warn('nonObjectDependencies', deps) + delete data[deps] + return + } + Object.keys(data[deps]).forEach(function (d) { + var r = data[deps][d] + if (typeof r !== 'string') { + this.warn('nonStringDependency', d, JSON.stringify(r)) + delete data[deps][d] + } + var hosted = hostedGitInfo.fromUrl(data[deps][d]) + if (hosted) { + data[deps][d] = hosted.toString() + } + }, this) + }, this) + }, -/** - * Removes `key` and its value from the hash. - * - * @private - * @name delete - * @memberOf Hash - * @param {Object} hash The hash to modify. - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function hashDelete(key) { - return this.has(key) && delete this.__data__[key]; -} + fixModulesField: function (data) { + if (data.modules) { + this.warn('deprecatedModules') + delete data.modules + } + }, -/** - * Gets the hash value for `key`. - * - * @private - * @name get - * @memberOf Hash - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function hashGet(key) { - var data = this.__data__; - if (nativeCreate) { - var result = data[key]; - return result === HASH_UNDEFINED ? undefined : result; - } - return hasOwnProperty.call(data, key) ? data[key] : undefined; -} + fixKeywordsField: function (data) { + if (typeof data.keywords === 'string') { + data.keywords = data.keywords.split(/,\s+/) + } + if (data.keywords && !Array.isArray(data.keywords)) { + delete data.keywords + this.warn('nonArrayKeywords') + } else if (data.keywords) { + data.keywords = data.keywords.filter(function (kw) { + if (typeof kw !== 'string' || !kw) { + this.warn('nonStringKeyword') + return false + } else { + return true + } + }, this) + } + }, -/** - * Checks if a hash value for `key` exists. - * - * @private - * @name has - * @memberOf Hash - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function hashHas(key) { - var data = this.__data__; - return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); -} + fixVersionField: function (data, strict) { + // allow "loose" semver 1.0 versions in non-strict mode + // enforce strict semver 2.0 compliance in strict mode + var loose = !strict + if (!data.version) { + data.version = '' + return true + } + if (!isValidSemver(data.version, loose)) { + throw new Error('Invalid version: "' + data.version + '"') + } + data.version = cleanSemver(data.version, loose) + return true + }, -/** - * Sets the hash `key` to `value`. - * - * @private - * @name set - * @memberOf Hash - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the hash instance. - */ -function hashSet(key, value) { - var data = this.__data__; - data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; - return this; -} + fixPeople: function (data) { + modifyPeople(data, unParsePerson) + modifyPeople(data, parsePerson) + }, -// Add methods to `Hash`. -Hash.prototype.clear = hashClear; -Hash.prototype['delete'] = hashDelete; -Hash.prototype.get = hashGet; -Hash.prototype.has = hashHas; -Hash.prototype.set = hashSet; + fixNameField: function (data, options) { + if (typeof options === 'boolean') { + options = { strict: options } + } else if (typeof options === 'undefined') { + options = {} + } + var strict = options.strict + if (!data.name && !strict) { + data.name = '' + return + } + if (typeof data.name !== 'string') { + throw new Error('name field must be a string.') + } + if (!strict) { + data.name = data.name.trim() + } + ensureValidName(data.name, strict, options.allowLegacyCase) + if (isBuiltinModule(data.name)) { + this.warn('conflictingName', data.name) + } + }, -/** - * Creates an list cache object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function ListCache(entries) { - var index = -1, - length = entries ? entries.length : 0; + fixDescriptionField: function (data) { + if (data.description && typeof data.description !== 'string') { + this.warn('nonStringDescription') + delete data.description + } + if (data.readme && !data.description) { + data.description = extractDescription(data.readme) + } + if (data.description === undefined) { + delete data.description + } + if (!data.description) { + this.warn('missingDescription') + } + }, - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} + fixReadmeField: function (data) { + if (!data.readme) { + this.warn('missingReadme') + data.readme = 'ERROR: No README data found!' + } + }, -/** - * Removes all key-value entries from the list cache. - * - * @private - * @name clear - * @memberOf ListCache - */ -function listCacheClear() { - this.__data__ = []; -} + fixBugsField: function (data) { + if (!data.bugs && data.repository && data.repository.url) { + var hosted = hostedGitInfo.fromUrl(data.repository.url) + if (hosted && hosted.bugs()) { + data.bugs = { url: hosted.bugs() } + } + } else if (data.bugs) { + if (typeof data.bugs === 'string') { + if (isEmail(data.bugs)) { + data.bugs = { email: data.bugs } + /* eslint-disable-next-line node/no-deprecated-api */ + } else if (url.parse(data.bugs).protocol) { + data.bugs = { url: data.bugs } + } else { + this.warn('nonEmailUrlBugsString') + } + } else { + bugsTypos(data.bugs, this.warn) + var oldBugs = data.bugs + data.bugs = {} + if (oldBugs.url) { + /* eslint-disable-next-line node/no-deprecated-api */ + if (typeof (oldBugs.url) === 'string' && url.parse(oldBugs.url).protocol) { + data.bugs.url = oldBugs.url + } else { + this.warn('nonUrlBugsUrlField') + } + } + if (oldBugs.email) { + if (typeof (oldBugs.email) === 'string' && isEmail(oldBugs.email)) { + data.bugs.email = oldBugs.email + } else { + this.warn('nonEmailBugsEmailField') + } + } + } + if (!data.bugs.email && !data.bugs.url) { + delete data.bugs + this.warn('emptyNormalizedBugs') + } + } + }, -/** - * Removes `key` and its value from the list cache. - * - * @private - * @name delete - * @memberOf ListCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function listCacheDelete(key) { - var data = this.__data__, - index = assocIndexOf(data, key); + fixHomepageField: function (data) { + if (!data.homepage && data.repository && data.repository.url) { + var hosted = hostedGitInfo.fromUrl(data.repository.url) + if (hosted && hosted.docs()) { + data.homepage = hosted.docs() + } + } + if (!data.homepage) { + return + } - if (index < 0) { - return false; + if (typeof data.homepage !== 'string') { + this.warn('nonUrlHomepage') + return delete data.homepage + } + /* eslint-disable-next-line node/no-deprecated-api */ + if (!url.parse(data.homepage).protocol) { + data.homepage = 'http://' + data.homepage + } + }, + + fixLicenseField: function (data) { + const license = data.license || data.licence + if (!license) { + return this.warn('missingLicense') + } + if ( + typeof (license) !== 'string' || + license.length < 1 || + license.trim() === '' + ) { + return this.warn('invalidLicense') + } + if (!validateLicense(license).validForNewPackages) { + return this.warn('invalidLicense') + } + }, +} + +function isValidScopedPackageName (spec) { + if (spec.charAt(0) !== '@') { + return false } - var lastIndex = data.length - 1; - if (index == lastIndex) { - data.pop(); - } else { - splice.call(data, index, 1); + + var rest = spec.slice(1).split('/') + if (rest.length !== 2) { + return false } - return true; + + return rest[0] && rest[1] && + rest[0] === encodeURIComponent(rest[0]) && + rest[1] === encodeURIComponent(rest[1]) } -/** - * Gets the list cache value for `key`. - * - * @private - * @name get - * @memberOf ListCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function listCacheGet(key) { - var data = this.__data__, - index = assocIndexOf(data, key); +function isCorrectlyEncodedName (spec) { + return !spec.match(/[/@\s+%:]/) && + spec === encodeURIComponent(spec) +} - return index < 0 ? undefined : data[index][1]; +function ensureValidName (name, strict, allowLegacyCase) { + if (name.charAt(0) === '.' || + !(isValidScopedPackageName(name) || isCorrectlyEncodedName(name)) || + (strict && (!allowLegacyCase) && name !== name.toLowerCase()) || + name.toLowerCase() === 'node_modules' || + name.toLowerCase() === 'favicon.ico') { + throw new Error('Invalid name: ' + JSON.stringify(name)) + } } -/** - * Checks if a list cache value for `key` exists. - * - * @private - * @name has - * @memberOf ListCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function listCacheHas(key) { - return assocIndexOf(this.__data__, key) > -1; +function modifyPeople (data, fn) { + if (data.author) { + data.author = fn(data.author) + }['maintainers', 'contributors'].forEach(function (set) { + if (!Array.isArray(data[set])) { + return + } + data[set] = data[set].map(fn) + }) + return data } -/** - * Sets the list cache `key` to `value`. - * - * @private - * @name set - * @memberOf ListCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the list cache instance. - */ -function listCacheSet(key, value) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - data.push([key, value]); - } else { - data[index][1] = value; +function unParsePerson (person) { + if (typeof person === 'string') { + return person } - return this; + var name = person.name || '' + var u = person.url || person.web + var wrappedUrl = u ? (' (' + u + ')') : '' + var e = person.email || person.mail + var wrappedEmail = e ? (' <' + e + '>') : '' + return name + wrappedEmail + wrappedUrl } -// Add methods to `ListCache`. -ListCache.prototype.clear = listCacheClear; -ListCache.prototype['delete'] = listCacheDelete; -ListCache.prototype.get = listCacheGet; -ListCache.prototype.has = listCacheHas; -ListCache.prototype.set = listCacheSet; - -/** - * Creates a map cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function MapCache(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); +function parsePerson (person) { + if (typeof person !== 'string') { + return person } + var matchedName = person.match(/^([^(<]+)/) + var matchedUrl = person.match(/\(([^()]+)\)/) + var matchedEmail = person.match(/<([^<>]+)>/) + var obj = {} + if (matchedName && matchedName[0].trim()) { + obj.name = matchedName[0].trim() + } + if (matchedEmail) { + obj.email = matchedEmail[1] + } + if (matchedUrl) { + obj.url = matchedUrl[1] + } + return obj } -/** - * Removes all key-value entries from the map. - * - * @private - * @name clear - * @memberOf MapCache - */ -function mapCacheClear() { - this.__data__ = { - 'hash': new Hash, - 'map': new (Map || ListCache), - 'string': new Hash - }; -} - -/** - * Removes `key` and its value from the map. - * - * @private - * @name delete - * @memberOf MapCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function mapCacheDelete(key) { - return getMapData(this, key)['delete'](key); +function addOptionalDepsToDeps (data, warn) { + var o = data.optionalDependencies + if (!o) { + return + } + var d = data.dependencies || {} + Object.keys(o).forEach(function (k) { + d[k] = o[k] + }) + data.dependencies = d } -/** - * Gets the map value for `key`. - * - * @private - * @name get - * @memberOf MapCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function mapCacheGet(key) { - return getMapData(this, key).get(key); +function depObjectify (deps, type, warn) { + if (!deps) { + return {} + } + if (typeof deps === 'string') { + deps = deps.trim().split(/[\n\r\s\t ,]+/) + } + if (!Array.isArray(deps)) { + return deps + } + warn('deprecatedArrayDependencies', type) + var o = {} + deps.filter(function (d) { + return typeof d === 'string' + }).forEach(function (d) { + d = d.trim().split(/(:?[@\s><=])/) + var dn = d.shift() + var dv = d.join('') + dv = dv.trim() + dv = dv.replace(/^@/, '') + o[dn] = dv + }) + return o } -/** - * Checks if a map value for `key` exists. - * - * @private - * @name has - * @memberOf MapCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function mapCacheHas(key) { - return getMapData(this, key).has(key); +function objectifyDeps (data, warn) { + depTypes.forEach(function (type) { + if (!data[type]) { + return + } + data[type] = depObjectify(data[type], type, warn) + }) } -/** - * Sets the map `key` to `value`. - * - * @private - * @name set - * @memberOf MapCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the map cache instance. - */ -function mapCacheSet(key, value) { - getMapData(this, key).set(key, value); - return this; +function bugsTypos (bugs, warn) { + if (!bugs) { + return + } + Object.keys(bugs).forEach(function (k) { + if (typos.bugs[k]) { + warn('typo', k, typos.bugs[k], 'bugs') + bugs[typos.bugs[k]] = bugs[k] + delete bugs[k] + } + }) } -// Add methods to `MapCache`. -MapCache.prototype.clear = mapCacheClear; -MapCache.prototype['delete'] = mapCacheDelete; -MapCache.prototype.get = mapCacheGet; -MapCache.prototype.has = mapCacheHas; -MapCache.prototype.set = mapCacheSet; - -/** - * Creates a stack cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function Stack(entries) { - this.__data__ = new ListCache(entries); -} -/** - * Removes all key-value entries from the stack. - * - * @private - * @name clear - * @memberOf Stack - */ -function stackClear() { - this.__data__ = new ListCache; -} +/***/ }), -/** - * Removes `key` and its value from the stack. - * - * @private - * @name delete - * @memberOf Stack - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function stackDelete(key) { - return this.__data__['delete'](key); -} +/***/ 9671: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** - * Gets the stack value for `key`. - * - * @private - * @name get - * @memberOf Stack - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function stackGet(key) { - return this.__data__.get(key); -} +var util = __nccwpck_require__(3837) +var messages = __nccwpck_require__(6271) -/** - * Checks if a stack value for `key` exists. - * - * @private - * @name has - * @memberOf Stack - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function stackHas(key) { - return this.__data__.has(key); +module.exports = function () { + var args = Array.prototype.slice.call(arguments, 0) + var warningName = args.shift() + if (warningName === 'typo') { + return makeTypoWarning.apply(null, args) + } else { + var msgTemplate = messages[warningName] ? messages[warningName] : warningName + ": '%s'" + args.unshift(msgTemplate) + return util.format.apply(null, args) + } } -/** - * Sets the stack `key` to `value`. - * - * @private - * @name set - * @memberOf Stack - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the stack cache instance. - */ -function stackSet(key, value) { - var cache = this.__data__; - if (cache instanceof ListCache) { - var pairs = cache.__data__; - if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { - pairs.push([key, value]); - return this; - } - cache = this.__data__ = new MapCache(pairs); +function makeTypoWarning (providedName, probableName, field) { + if (field) { + providedName = field + "['" + providedName + "']" + probableName = field + "['" + probableName + "']" } - cache.set(key, value); - return this; + return util.format(messages.typo, providedName, probableName) } -// Add methods to `Stack`. -Stack.prototype.clear = stackClear; -Stack.prototype['delete'] = stackDelete; -Stack.prototype.get = stackGet; -Stack.prototype.has = stackHas; -Stack.prototype.set = stackSet; -/** - * Creates an array of the enumerable property names of the array-like `value`. - * - * @private - * @param {*} value The value to query. - * @param {boolean} inherited Specify returning inherited property names. - * @returns {Array} Returns the array of property names. - */ -function arrayLikeKeys(value, inherited) { - // Safari 8.1 makes `arguments.callee` enumerable in strict mode. - // Safari 9 makes `arguments.length` enumerable in strict mode. - var result = (isArray(value) || isArguments(value)) - ? baseTimes(value.length, String) - : []; +/***/ }), - var length = result.length, - skipIndexes = !!length; +/***/ 3188: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - for (var key in value) { - if ((inherited || hasOwnProperty.call(value, key)) && - !(skipIndexes && (key == 'length' || isIndex(key, length)))) { - result.push(key); - } - } - return result; -} +module.exports = normalize -/** - * Assigns `value` to `key` of `object` if the existing value is not equivalent - * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ -function assignValue(object, key, value) { - var objValue = object[key]; - if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || - (value === undefined && !(key in object))) { - object[key] = value; - } -} +var fixer = __nccwpck_require__(3492) +normalize.fixer = fixer -/** - * Gets the index at which the `key` is found in `array` of key-value pairs. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} key The key to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function assocIndexOf(array, key) { - var length = array.length; - while (length--) { - if (eq(array[length][0], key)) { - return length; - } - } - return -1; -} +var makeWarning = __nccwpck_require__(9671) -/** - * The base implementation of `_.assign` without support for multiple sources - * or `customizer` functions. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @returns {Object} Returns `object`. - */ -function baseAssign(object, source) { - return object && copyObject(source, keys(source), object); -} +var fieldsToFix = ['name', 'version', 'description', 'repository', 'modules', 'scripts', + 'files', 'bin', 'man', 'bugs', 'keywords', 'readme', 'homepage', 'license'] +var otherThingsToFix = ['dependencies', 'people', 'typos'] -/** - * The base implementation of `_.clone` and `_.cloneDeep` which tracks - * traversed objects. - * - * @private - * @param {*} value The value to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @param {boolean} [isFull] Specify a clone including symbols. - * @param {Function} [customizer] The function to customize cloning. - * @param {string} [key] The key of `value`. - * @param {Object} [object] The parent object of `value`. - * @param {Object} [stack] Tracks traversed objects and their clone counterparts. - * @returns {*} Returns the cloned value. - */ -function baseClone(value, isDeep, isFull, customizer, key, object, stack) { - var result; - if (customizer) { - result = object ? customizer(value, key, object, stack) : customizer(value); +var thingsToFix = fieldsToFix.map(function (fieldName) { + return ucFirst(fieldName) + 'Field' +}) +// two ways to do this in CoffeeScript on only one line, sub-70 chars: +// thingsToFix = fieldsToFix.map (name) -> ucFirst(name) + "Field" +// thingsToFix = (ucFirst(name) + "Field" for name in fieldsToFix) +thingsToFix = thingsToFix.concat(otherThingsToFix) + +function normalize (data, warn, strict) { + if (warn === true) { + warn = null + strict = true } - if (result !== undefined) { - return result; + if (!strict) { + strict = false } - if (!isObject(value)) { - return value; + if (!warn || data.private) { + warn = function (msg) { /* noop */ } } - var isArr = isArray(value); - if (isArr) { - result = initCloneArray(value); - if (!isDeep) { - return copyArray(value, result); - } - } else { - var tag = getTag(value), - isFunc = tag == funcTag || tag == genTag; - if (isBuffer(value)) { - return cloneBuffer(value, isDeep); - } - if (tag == objectTag || tag == argsTag || (isFunc && !object)) { - if (isHostObject(value)) { - return object ? value : {}; - } - result = initCloneObject(isFunc ? {} : value); - if (!isDeep) { - return copySymbols(value, baseAssign(result, value)); - } - } else { - if (!cloneableTags[tag]) { - return object ? value : {}; - } - result = initCloneByTag(value, tag, baseClone, isDeep); - } - } - // Check for circular references and return its corresponding clone. - stack || (stack = new Stack); - var stacked = stack.get(value); - if (stacked) { - return stacked; + if (data.scripts && + data.scripts.install === 'node-gyp rebuild' && + !data.scripts.preinstall) { + data.gypfile = true } - stack.set(value, result); - - if (!isArr) { - var props = isFull ? getAllKeys(value) : keys(value); + fixer.warn = function () { + warn(makeWarning.apply(null, arguments)) } - arrayEach(props || value, function(subValue, key) { - if (props) { - key = subValue; - subValue = value[key]; - } - // Recursively populate clone (susceptible to call stack limits). - assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack)); - }); - return result; + thingsToFix.forEach(function (thingName) { + fixer['fix' + ucFirst(thingName)](data, strict) + }) + data._id = data.name + '@' + data.version } -/** - * The base implementation of `_.create` without support for assigning - * properties to the created object. - * - * @private - * @param {Object} prototype The object to inherit from. - * @returns {Object} Returns the new object. - */ -function baseCreate(proto) { - return isObject(proto) ? objectCreate(proto) : {}; +function ucFirst (string) { + return string.charAt(0).toUpperCase() + string.slice(1) } -/** - * The base implementation of `getAllKeys` and `getAllKeysIn` which uses - * `keysFunc` and `symbolsFunc` to get the enumerable property names and - * symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {Function} keysFunc The function to get the keys of `object`. - * @param {Function} symbolsFunc The function to get the symbols of `object`. - * @returns {Array} Returns the array of property names and symbols. - */ -function baseGetAllKeys(object, keysFunc, symbolsFunc) { - var result = keysFunc(object); - return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); -} -/** - * The base implementation of `getTag`. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ -function baseGetTag(value) { - return objectToString.call(value); -} +/***/ }), -/** - * The base implementation of `_.isNative` without bad shim checks. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, - * else `false`. - */ -function baseIsNative(value) { - if (!isObject(value) || isMasked(value)) { - return false; - } - var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; - return pattern.test(toSource(value)); -} +/***/ 6293: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** - * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ -function baseKeys(object) { - if (!isPrototype(object)) { - return nativeKeys(object); - } - var result = []; - for (var key in Object(object)) { - if (hasOwnProperty.call(object, key) && key != 'constructor') { - result.push(key); - } - } - return result; -} +// pass in a manifest with a 'bin' field here, and it'll turn it +// into a properly santized bin object +const { join, basename } = __nccwpck_require__(1017) -/** - * Creates a clone of `buffer`. - * - * @private - * @param {Buffer} buffer The buffer to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Buffer} Returns the cloned buffer. - */ -function cloneBuffer(buffer, isDeep) { - if (isDeep) { - return buffer.slice(); - } - var result = new buffer.constructor(buffer.length); - buffer.copy(result); - return result; -} +const normalize = pkg => + !pkg.bin ? removeBin(pkg) + : typeof pkg.bin === 'string' ? normalizeString(pkg) + : Array.isArray(pkg.bin) ? normalizeArray(pkg) + : typeof pkg.bin === 'object' ? normalizeObject(pkg) + : removeBin(pkg) -/** - * Creates a clone of `arrayBuffer`. - * - * @private - * @param {ArrayBuffer} arrayBuffer The array buffer to clone. - * @returns {ArrayBuffer} Returns the cloned array buffer. - */ -function cloneArrayBuffer(arrayBuffer) { - var result = new arrayBuffer.constructor(arrayBuffer.byteLength); - new Uint8Array(result).set(new Uint8Array(arrayBuffer)); - return result; +const normalizeString = pkg => { + if (!pkg.name) { + return removeBin(pkg) + } + pkg.bin = { [pkg.name]: pkg.bin } + return normalizeObject(pkg) } -/** - * Creates a clone of `dataView`. - * - * @private - * @param {Object} dataView The data view to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned data view. - */ -function cloneDataView(dataView, isDeep) { - var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; - return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); +const normalizeArray = pkg => { + pkg.bin = pkg.bin.reduce((acc, k) => { + acc[basename(k)] = k + return acc + }, {}) + return normalizeObject(pkg) } -/** - * Creates a clone of `map`. - * - * @private - * @param {Object} map The map to clone. - * @param {Function} cloneFunc The function to clone values. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned map. - */ -function cloneMap(map, isDeep, cloneFunc) { - var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map); - return arrayReduce(array, addMapEntry, new map.constructor); +const removeBin = pkg => { + delete pkg.bin + return pkg } -/** - * Creates a clone of `regexp`. - * - * @private - * @param {Object} regexp The regexp to clone. - * @returns {Object} Returns the cloned regexp. - */ -function cloneRegExp(regexp) { - var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); - result.lastIndex = regexp.lastIndex; - return result; -} +const normalizeObject = pkg => { + const orig = pkg.bin + const clean = {} + let hasBins = false + Object.keys(orig).forEach(binKey => { + const base = join('/', basename(binKey.replace(/\\|:/g, '/'))).slice(1) -/** - * Creates a clone of `set`. - * - * @private - * @param {Object} set The set to clone. - * @param {Function} cloneFunc The function to clone values. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned set. - */ -function cloneSet(set, isDeep, cloneFunc) { - var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set); - return arrayReduce(array, addSetEntry, new set.constructor); -} + if (typeof orig[binKey] !== 'string' || !base) { + return + } -/** - * Creates a clone of the `symbol` object. - * - * @private - * @param {Object} symbol The symbol object to clone. - * @returns {Object} Returns the cloned symbol object. - */ -function cloneSymbol(symbol) { - return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; -} + const binTarget = join('/', orig[binKey].replace(/\\/g, '/')) + .replace(/\\/g, '/').slice(1) -/** - * Creates a clone of `typedArray`. - * - * @private - * @param {Object} typedArray The typed array to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned typed array. - */ -function cloneTypedArray(typedArray, isDeep) { - var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; - return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); -} + if (!binTarget) { + return + } -/** - * Copies the values of `source` to `array`. - * - * @private - * @param {Array} source The array to copy values from. - * @param {Array} [array=[]] The array to copy values to. - * @returns {Array} Returns `array`. - */ -function copyArray(source, array) { - var index = -1, - length = source.length; + clean[base] = binTarget + hasBins = true + }) - array || (array = Array(length)); - while (++index < length) { - array[index] = source[index]; + if (hasBins) { + pkg.bin = clean + } else { + delete pkg.bin } - return array; -} - -/** - * Copies properties of `source` to `object`. - * - * @private - * @param {Object} source The object to copy properties from. - * @param {Array} props The property identifiers to copy. - * @param {Object} [object={}] The object to copy properties to. - * @param {Function} [customizer] The function to customize copied values. - * @returns {Object} Returns `object`. - */ -function copyObject(source, props, object, customizer) { - object || (object = {}); - var index = -1, - length = props.length; + return pkg +} - while (++index < length) { - var key = props[index]; +module.exports = normalize - var newValue = customizer - ? customizer(object[key], source[key], key, object, source) - : undefined; - assignValue(object, key, newValue === undefined ? source[key] : newValue); - } - return object; -} +/***/ }), -/** - * Copies own symbol properties of `source` to `object`. - * - * @private - * @param {Object} source The object to copy symbols from. - * @param {Object} [object={}] The object to copy symbols to. - * @returns {Object} Returns `object`. - */ -function copySymbols(source, object) { - return copyObject(source, getSymbols(source), object); -} +/***/ 2057: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/** - * Creates an array of own enumerable property names and symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names and symbols. - */ -function getAllKeys(object) { - return baseGetAllKeys(object, keys, getSymbols); -} -/** - * Gets the data for `map`. - * - * @private - * @param {Object} map The map to query. - * @param {string} key The reference key. - * @returns {*} Returns the map data. - */ -function getMapData(map, key) { - var data = map.__data__; - return isKeyable(key) - ? data[typeof key == 'string' ? 'string' : 'hash'] - : data.map; -} +// Walk through the file-system "database" of installed +// packages, and create a data object related to the +// installed versions of each package. -/** - * Gets the native function at `key` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. - */ -function getNative(object, key) { - var value = getValue(object, key); - return baseIsNative(value) ? value : undefined; -} +/* +This will traverse through all node_modules folders, +resolving the dependencies object to the object corresponding to +the package that meets that dep, or just the version/range if +unmet. -/** - * Creates an array of the own enumerable symbol properties of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of symbols. - */ -var getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray; +Assuming that you had this folder structure: -/** - * Gets the `toStringTag` of `value`. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ -var getTag = baseGetTag; +/path/to ++-- package.json { name = "root" } +`-- node_modules + +-- foo {bar, baz, asdf} + | +-- node_modules + | +-- bar { baz } + | `-- baz + `-- asdf -// Fallback for data views, maps, sets, and weak maps in IE 11, -// for data views in Edge < 14, and promises in Node.js. -if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || - (Map && getTag(new Map) != mapTag) || - (Promise && getTag(Promise.resolve()) != promiseTag) || - (Set && getTag(new Set) != setTag) || - (WeakMap && getTag(new WeakMap) != weakMapTag)) { - getTag = function(value) { - var result = objectToString.call(value), - Ctor = result == objectTag ? value.constructor : undefined, - ctorString = Ctor ? toSource(Ctor) : undefined; +where "foo" depends on bar, baz, and asdf, bar depends on baz, +and bar and baz are bundled with foo, whereas "asdf" is at +the higher level (sibling to foo), you'd get this object structure: - if (ctorString) { - switch (ctorString) { - case dataViewCtorString: return dataViewTag; - case mapCtorString: return mapTag; - case promiseCtorString: return promiseTag; - case setCtorString: return setTag; - case weakMapCtorString: return weakMapTag; +{ +, path: "/path/to" +, parent: null +, dependencies: + { foo : + { version: "1.2.3" + , path: "/path/to/node_modules/foo" + , parent: + , dependencies: + { bar: + { parent: + , path: "/path/to/node_modules/foo/node_modules/bar" + , version: "2.3.4" + , dependencies: { baz: } + } + , baz: { ... } + , asdf: } } - return result; - }; + , asdf: { ... } + } } -/** - * Initializes an array clone. - * - * @private - * @param {Array} array The array to clone. - * @returns {Array} Returns the initialized clone. - */ -function initCloneArray(array) { - var length = array.length, - result = array.constructor(length); +Unmet deps are left as strings. +Extraneous deps are marked with extraneous:true +deps that don't meet a requirement are marked with invalid:true +deps that don't meet a peer requirement are marked with peerInvalid:true - // Add properties assigned by `RegExp#exec`. - if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { - result.index = array.index; - result.input = array.input; - } - return result; -} +to READ(packagefolder, parentobj, name, reqver) +obj = read package.json +installed = ./node_modules/* +if parentobj is null, and no package.json + obj = {dependencies:{:ANY}} +deps = Object.keys(obj.dependencies) +obj.path = packagefolder +obj.parent = parentobj +if name, && obj.name !== name, obj.invalid = true +if reqver, && obj.version !satisfies reqver, obj.invalid = true +if !reqver && parentobj, obj.extraneous = true +for each folder in installed + obj.dependencies[folder] = READ(packagefolder+node_modules+folder, + obj, folder, obj.dependencies[folder]) +# walk tree to find unmet deps +for each dep in obj.dependencies not in installed + r = obj.parent + while r + if r.dependencies[dep] + if r.dependencies[dep].verion !satisfies obj.dependencies[dep] + WARN + r.dependencies[dep].invalid = true + obj.dependencies[dep] = r.dependencies[dep] + r = null + else r = r.parent +return obj -/** - * Initializes an object clone. - * - * @private - * @param {Object} object The object to clone. - * @returns {Object} Returns the initialized clone. - */ -function initCloneObject(object) { - return (typeof object.constructor == 'function' && !isPrototype(object)) - ? baseCreate(getPrototype(object)) - : {}; -} -/** - * Initializes an object clone based on its `toStringTag`. - * - * **Note:** This function only supports cloning values with tags of - * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. - * - * @private - * @param {Object} object The object to clone. - * @param {string} tag The `toStringTag` of the object to clone. - * @param {Function} cloneFunc The function to clone values. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the initialized clone. - */ -function initCloneByTag(object, tag, cloneFunc, isDeep) { - var Ctor = object.constructor; - switch (tag) { - case arrayBufferTag: - return cloneArrayBuffer(object); +TODO: +1. Find unmet deps in parent directories, searching as node does up +as far as the left-most node_modules folder. +2. Ignore anything in node_modules that isn't a package folder. - case boolTag: - case dateTag: - return new Ctor(+object); +*/ - case dataViewTag: - return cloneDataView(object, isDeep); +try { + var fs = __nccwpck_require__(7758) +} catch (er) { + var fs = __nccwpck_require__(7147) +} - case float32Tag: case float64Tag: - case int8Tag: case int16Tag: case int32Tag: - case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: - return cloneTypedArray(object, isDeep); +var path = __nccwpck_require__(1017) +var asyncMap = (__nccwpck_require__(6029).asyncMap) +var semver = __nccwpck_require__(1383) +var readJson = __nccwpck_require__(4086) - case mapTag: - return cloneMap(object, isDeep, cloneFunc); +var debug = __nccwpck_require__(8237)("read-installed") - case numberTag: - case stringTag: - return new Ctor(object); +var { readdirScoped } = __nccwpck_require__(575) - case regexpTag: - return cloneRegExp(object); +// Sentinel catch-all version constraint used when a dependency is not +// listed in the package.json file. +var ANY = {} - case setTag: - return cloneSet(object, isDeep, cloneFunc); +module.exports = readInstalled - case symbolTag: - return cloneSymbol(object); +function readInstalled (folder, opts, cb) { + if (typeof opts === 'function') { + cb = opts + opts = {} + } else { + opts = Object.assign({}, opts) } -} -/** - * Checks if `value` is a valid array-like index. - * - * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. - */ -function isIndex(value, length) { - length = length == null ? MAX_SAFE_INTEGER : length; - return !!length && - (typeof value == 'number' || reIsUint.test(value)) && - (value > -1 && value % 1 == 0 && value < length); -} + if (typeof opts.depth !== 'number') + opts.depth = Infinity -/** - * Checks if `value` is suitable for use as unique object key. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is suitable, else `false`. - */ -function isKeyable(value) { - var type = typeof value; - return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') - ? (value !== '__proto__') - : (value === null); -} - -/** - * Checks if `func` has its source masked. - * - * @private - * @param {Function} func The function to check. - * @returns {boolean} Returns `true` if `func` is masked, else `false`. - */ -function isMasked(func) { - return !!maskSrcKey && (maskSrcKey in func); -} - -/** - * Checks if `value` is likely a prototype object. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. - */ -function isPrototype(value) { - var Ctor = value && value.constructor, - proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; - - return value === proto; -} - -/** - * Converts `func` to its source code. - * - * @private - * @param {Function} func The function to process. - * @returns {string} Returns the source code. - */ -function toSource(func) { - if (func != null) { - try { - return funcToString.call(func); - } catch (e) {} - try { - return (func + ''); - } catch (e) {} - } - return ''; -} - -/** - * This method is like `_.clone` except that it recursively clones `value`. - * - * @static - * @memberOf _ - * @since 1.0.0 - * @category Lang - * @param {*} value The value to recursively clone. - * @returns {*} Returns the deep cloned value. - * @see _.clone - * @example - * - * var objects = [{ 'a': 1 }, { 'b': 2 }]; - * - * var deep = _.cloneDeep(objects); - * console.log(deep[0] === objects[0]); - * // => false - */ -function cloneDeep(value) { - return baseClone(value, true, true); -} - -/** - * Performs a - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'a': 1 }; - * var other = { 'a': 1 }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ -function eq(value, other) { - return value === other || (value !== value && other !== other); -} - -/** - * Checks if `value` is likely an `arguments` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an `arguments` object, - * else `false`. - * @example - * - * _.isArguments(function() { return arguments; }()); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false - */ -function isArguments(value) { - // Safari 8.1 makes `arguments.callee` enumerable in strict mode. - return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && - (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); -} - -/** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false - * - * _.isArray(_.noop); - * // => false - */ -var isArray = Array.isArray; - -/** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ -function isArrayLike(value) { - return value != null && isLength(value.length) && !isFunction(value); -} - -/** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, - * else `false`. - * @example - * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); - * // => true - * - * _.isArrayLikeObject('abc'); - * // => false - * - * _.isArrayLikeObject(_.noop); - * // => false - */ -function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); -} - -/** - * Checks if `value` is a buffer. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. - * @example - * - * _.isBuffer(new Buffer(2)); - * // => true - * - * _.isBuffer(new Uint8Array(2)); - * // => false - */ -var isBuffer = nativeIsBuffer || stubFalse; - -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a function, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8-9 which returns 'object' for typed array and other constructors. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; -} - -/** - * Checks if `value` is a valid array-like length. - * - * **Note:** This method is loosely based on - * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */ -function isLength(value) { - return typeof value == 'number' && - value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; -} - -/** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** - * Creates an array of the own enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. See the - * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) - * for more details. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keys(new Foo); - * // => ['a', 'b'] (iteration order is not guaranteed) - * - * _.keys('hi'); - * // => ['0', '1'] - */ -function keys(object) { - return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); -} - -/** - * This method returns a new empty array. - * - * @static - * @memberOf _ - * @since 4.13.0 - * @category Util - * @returns {Array} Returns the new empty array. - * @example - * - * var arrays = _.times(2, _.stubArray); - * - * console.log(arrays); - * // => [[], []] - * - * console.log(arrays[0] === arrays[1]); - * // => false - */ -function stubArray() { - return []; -} - -/** - * This method returns `false`. - * - * @static - * @memberOf _ - * @since 4.13.0 - * @category Util - * @returns {boolean} Returns `false`. - * @example - * - * _.times(2, _.stubFalse); - * // => [false, false] - */ -function stubFalse() { - return false; -} - -module.exports = cloneDeep; - - -/***/ }), - -/***/ 6186: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const optsArg = __nccwpck_require__(2853) -const pathArg = __nccwpck_require__(2930) - -const {mkdirpNative, mkdirpNativeSync} = __nccwpck_require__(4983) -const {mkdirpManual, mkdirpManualSync} = __nccwpck_require__(356) -const {useNative, useNativeSync} = __nccwpck_require__(4518) - - -const mkdirp = (path, opts) => { - path = pathArg(path) - opts = optsArg(opts) - return useNative(opts) - ? mkdirpNative(path, opts) - : mkdirpManual(path, opts) -} - -const mkdirpSync = (path, opts) => { - path = pathArg(path) - opts = optsArg(opts) - return useNativeSync(opts) - ? mkdirpNativeSync(path, opts) - : mkdirpManualSync(path, opts) -} - -mkdirp.sync = mkdirpSync -mkdirp.native = (path, opts) => mkdirpNative(pathArg(path), optsArg(opts)) -mkdirp.manual = (path, opts) => mkdirpManual(pathArg(path), optsArg(opts)) -mkdirp.nativeSync = (path, opts) => mkdirpNativeSync(pathArg(path), optsArg(opts)) -mkdirp.manualSync = (path, opts) => mkdirpManualSync(pathArg(path), optsArg(opts)) - -module.exports = mkdirp - - -/***/ }), - -/***/ 4992: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const {dirname} = __nccwpck_require__(1017) - -const findMade = (opts, parent, path = undefined) => { - // we never want the 'made' return value to be a root directory - if (path === parent) - return Promise.resolve() - - return opts.statAsync(parent).then( - st => st.isDirectory() ? path : undefined, // will fail later - er => er.code === 'ENOENT' - ? findMade(opts, dirname(parent), parent) - : undefined - ) -} - -const findMadeSync = (opts, parent, path = undefined) => { - if (path === parent) - return undefined - - try { - return opts.statSync(parent).isDirectory() ? path : undefined - } catch (er) { - return er.code === 'ENOENT' - ? findMadeSync(opts, dirname(parent), parent) - : undefined - } -} - -module.exports = {findMade, findMadeSync} - - -/***/ }), - -/***/ 356: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const {dirname} = __nccwpck_require__(1017) - -const mkdirpManual = (path, opts, made) => { - opts.recursive = false - const parent = dirname(path) - if (parent === path) { - return opts.mkdirAsync(path, opts).catch(er => { - // swallowed by recursive implementation on posix systems - // any other error is a failure - if (er.code !== 'EISDIR') - throw er - }) - } - - return opts.mkdirAsync(path, opts).then(() => made || path, er => { - if (er.code === 'ENOENT') - return mkdirpManual(parent, opts) - .then(made => mkdirpManual(path, opts, made)) - if (er.code !== 'EEXIST' && er.code !== 'EROFS') - throw er - return opts.statAsync(path).then(st => { - if (st.isDirectory()) - return made - else - throw er - }, () => { throw er }) - }) -} - -const mkdirpManualSync = (path, opts, made) => { - const parent = dirname(path) - opts.recursive = false - - if (parent === path) { - try { - return opts.mkdirSync(path, opts) - } catch (er) { - // swallowed by recursive implementation on posix systems - // any other error is a failure - if (er.code !== 'EISDIR') - throw er - else - return - } - } - - try { - opts.mkdirSync(path, opts) - return made || path - } catch (er) { - if (er.code === 'ENOENT') - return mkdirpManualSync(path, opts, mkdirpManualSync(parent, opts, made)) - if (er.code !== 'EEXIST' && er.code !== 'EROFS') - throw er - try { - if (!opts.statSync(path).isDirectory()) - throw er - } catch (_) { - throw er - } - } -} - -module.exports = {mkdirpManual, mkdirpManualSync} - - -/***/ }), - -/***/ 4983: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const {dirname} = __nccwpck_require__(1017) -const {findMade, findMadeSync} = __nccwpck_require__(4992) -const {mkdirpManual, mkdirpManualSync} = __nccwpck_require__(356) - -const mkdirpNative = (path, opts) => { - opts.recursive = true - const parent = dirname(path) - if (parent === path) - return opts.mkdirAsync(path, opts) - - return findMade(opts, path).then(made => - opts.mkdirAsync(path, opts).then(() => made) - .catch(er => { - if (er.code === 'ENOENT') - return mkdirpManual(path, opts) - else - throw er - })) -} - -const mkdirpNativeSync = (path, opts) => { - opts.recursive = true - const parent = dirname(path) - if (parent === path) - return opts.mkdirSync(path, opts) - - const made = findMadeSync(opts, path) - try { - opts.mkdirSync(path, opts) - return made - } catch (er) { - if (er.code === 'ENOENT') - return mkdirpManualSync(path, opts) - else - throw er - } -} - -module.exports = {mkdirpNative, mkdirpNativeSync} - - -/***/ }), - -/***/ 2853: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const { promisify } = __nccwpck_require__(3837) -const fs = __nccwpck_require__(7147) -const optsArg = opts => { - if (!opts) - opts = { mode: 0o777, fs } - else if (typeof opts === 'object') - opts = { mode: 0o777, fs, ...opts } - else if (typeof opts === 'number') - opts = { mode: opts, fs } - else if (typeof opts === 'string') - opts = { mode: parseInt(opts, 8), fs } - else - throw new TypeError('invalid options argument') - - opts.mkdir = opts.mkdir || opts.fs.mkdir || fs.mkdir - opts.mkdirAsync = promisify(opts.mkdir) - opts.stat = opts.stat || opts.fs.stat || fs.stat - opts.statAsync = promisify(opts.stat) - opts.statSync = opts.statSync || opts.fs.statSync || fs.statSync - opts.mkdirSync = opts.mkdirSync || opts.fs.mkdirSync || fs.mkdirSync - return opts -} -module.exports = optsArg - - -/***/ }), - -/***/ 2930: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const platform = process.env.__TESTING_MKDIRP_PLATFORM__ || process.platform -const { resolve, parse } = __nccwpck_require__(1017) -const pathArg = path => { - if (/\0/.test(path)) { - // simulate same failure that node raises - throw Object.assign( - new TypeError('path must be a string without null bytes'), - { - path, - code: 'ERR_INVALID_ARG_VALUE', - } - ) - } - - path = resolve(path) - if (platform === 'win32') { - const badWinChars = /[*|"<>?:]/ - const {root} = parse(path) - if (badWinChars.test(path.substr(root.length))) { - throw Object.assign(new Error('Illegal characters in path.'), { - path, - code: 'EINVAL', - }) - } - } - - return path -} -module.exports = pathArg - - -/***/ }), - -/***/ 4518: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const fs = __nccwpck_require__(7147) - -const version = process.env.__TESTING_MKDIRP_NODE_VERSION__ || process.version -const versArr = version.replace(/^v/, '').split('.') -const hasNative = +versArr[0] > 10 || +versArr[0] === 10 && +versArr[1] >= 12 - -const useNative = !hasNative ? () => false : opts => opts.mkdir === fs.mkdir -const useNativeSync = !hasNative ? () => false : opts => opts.mkdirSync === fs.mkdirSync - -module.exports = {useNative, useNativeSync} - - -/***/ }), - -/***/ 900: -/***/ ((module) => { - -/** - * Helpers. - */ - -var s = 1000; -var m = s * 60; -var h = m * 60; -var d = h * 24; -var w = d * 7; -var y = d * 365.25; - -/** - * Parse or format the given `val`. - * - * Options: - * - * - `long` verbose formatting [false] - * - * @param {String|Number} val - * @param {Object} [options] - * @throws {Error} throw an error if val is not a non-empty string or a number - * @return {String|Number} - * @api public - */ - -module.exports = function(val, options) { - options = options || {}; - var type = typeof val; - if (type === 'string' && val.length > 0) { - return parse(val); - } else if (type === 'number' && isFinite(val)) { - return options.long ? fmtLong(val) : fmtShort(val); - } - throw new Error( - 'val is not a non-empty string or a valid number. val=' + - JSON.stringify(val) - ); -}; - -/** - * Parse the given `str` and return milliseconds. - * - * @param {String} str - * @return {Number} - * @api private - */ - -function parse(str) { - str = String(str); - if (str.length > 100) { - return; - } - var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( - str - ); - if (!match) { - return; - } - var n = parseFloat(match[1]); - var type = (match[2] || 'ms').toLowerCase(); - switch (type) { - case 'years': - case 'year': - case 'yrs': - case 'yr': - case 'y': - return n * y; - case 'weeks': - case 'week': - case 'w': - return n * w; - case 'days': - case 'day': - case 'd': - return n * d; - case 'hours': - case 'hour': - case 'hrs': - case 'hr': - case 'h': - return n * h; - case 'minutes': - case 'minute': - case 'mins': - case 'min': - case 'm': - return n * m; - case 'seconds': - case 'second': - case 'secs': - case 'sec': - case 's': - return n * s; - case 'milliseconds': - case 'millisecond': - case 'msecs': - case 'msec': - case 'ms': - return n; - default: - return undefined; - } -} - -/** - * Short format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function fmtShort(ms) { - var msAbs = Math.abs(ms); - if (msAbs >= d) { - return Math.round(ms / d) + 'd'; - } - if (msAbs >= h) { - return Math.round(ms / h) + 'h'; - } - if (msAbs >= m) { - return Math.round(ms / m) + 'm'; - } - if (msAbs >= s) { - return Math.round(ms / s) + 's'; - } - return ms + 'ms'; -} - -/** - * Long format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function fmtLong(ms) { - var msAbs = Math.abs(ms); - if (msAbs >= d) { - return plural(ms, msAbs, d, 'day'); - } - if (msAbs >= h) { - return plural(ms, msAbs, h, 'hour'); - } - if (msAbs >= m) { - return plural(ms, msAbs, m, 'minute'); - } - if (msAbs >= s) { - return plural(ms, msAbs, s, 'second'); - } - return ms + ' ms'; -} - -/** - * Pluralization helper. - */ - -function plural(ms, msAbs, n, name) { - var isPlural = msAbs >= n * 1.5; - return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); -} - - -/***/ }), - -/***/ 6976: -/***/ ((module) => { - -module.exports = extractDescription - -// Extracts description from contents of a readme file in markdown format -function extractDescription (d) { - if (!d) { - return - } - if (d === 'ERROR: No README data found!') { - return - } - // the first block of text before the first heading - // that isn't the first line heading - d = d.trim().split('\n') - let s = 0 - while (d[s] && d[s].trim().match(/^(#|$)/)) { - s++ - } - const l = d.length - let e = s + 1 - while (e < l && d[e].trim()) { - e++ - } - return d.slice(s, e).join(' ').trim() -} - - -/***/ }), - -/***/ 3492: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -var isValidSemver = __nccwpck_require__(9601) -var cleanSemver = __nccwpck_require__(8848) -var validateLicense = __nccwpck_require__(2524) -var hostedGitInfo = __nccwpck_require__(167) -var isBuiltinModule = __nccwpck_require__(6873) -var depTypes = ['dependencies', 'devDependencies', 'optionalDependencies'] -var extractDescription = __nccwpck_require__(6976) -var url = __nccwpck_require__(7310) -var typos = __nccwpck_require__(1947) - -var isEmail = str => str.includes('@') && (str.indexOf('@') < str.lastIndexOf('.')) - -module.exports = { - // default warning function - warn: function () {}, - - fixRepositoryField: function (data) { - if (data.repositories) { - this.warn('repositories') - data.repository = data.repositories[0] - } - if (!data.repository) { - return this.warn('missingRepository') - } - if (typeof data.repository === 'string') { - data.repository = { - type: 'git', - url: data.repository, - } - } - var r = data.repository.url || '' - if (r) { - var hosted = hostedGitInfo.fromUrl(r) - if (hosted) { - r = data.repository.url - = hosted.getDefaultRepresentation() === 'shortcut' ? hosted.https() : hosted.toString() - } - } - - if (r.match(/github.com\/[^/]+\/[^/]+\.git\.git$/)) { - this.warn('brokenGitUrl', r) - } - }, - - fixTypos: function (data) { - Object.keys(typos.topLevel).forEach(function (d) { - if (Object.prototype.hasOwnProperty.call(data, d)) { - this.warn('typo', d, typos.topLevel[d]) - } - }, this) - }, - - fixScriptsField: function (data) { - if (!data.scripts) { - return - } - if (typeof data.scripts !== 'object') { - this.warn('nonObjectScripts') - delete data.scripts - return - } - Object.keys(data.scripts).forEach(function (k) { - if (typeof data.scripts[k] !== 'string') { - this.warn('nonStringScript') - delete data.scripts[k] - } else if (typos.script[k] && !data.scripts[typos.script[k]]) { - this.warn('typo', k, typos.script[k], 'scripts') - } - }, this) - }, - - fixFilesField: function (data) { - var files = data.files - if (files && !Array.isArray(files)) { - this.warn('nonArrayFiles') - delete data.files - } else if (data.files) { - data.files = data.files.filter(function (file) { - if (!file || typeof file !== 'string') { - this.warn('invalidFilename', file) - return false - } else { - return true - } - }, this) - } - }, - - fixBinField: function (data) { - if (!data.bin) { - return - } - if (typeof data.bin === 'string') { - var b = {} - var match - if (match = data.name.match(/^@[^/]+[/](.*)$/)) { - b[match[1]] = data.bin - } else { - b[data.name] = data.bin - } - data.bin = b - } - }, - - fixManField: function (data) { - if (!data.man) { - return - } - if (typeof data.man === 'string') { - data.man = [data.man] - } - }, - fixBundleDependenciesField: function (data) { - var bdd = 'bundledDependencies' - var bd = 'bundleDependencies' - if (data[bdd] && !data[bd]) { - data[bd] = data[bdd] - delete data[bdd] - } - if (data[bd] && !Array.isArray(data[bd])) { - this.warn('nonArrayBundleDependencies') - delete data[bd] - } else if (data[bd]) { - data[bd] = data[bd].filter(function (filtered) { - if (!filtered || typeof filtered !== 'string') { - this.warn('nonStringBundleDependency', filtered) - return false - } else { - if (!data.dependencies) { - data.dependencies = {} - } - if (!Object.prototype.hasOwnProperty.call(data.dependencies, filtered)) { - this.warn('nonDependencyBundleDependency', filtered) - data.dependencies[filtered] = '*' - } - return true - } - }, this) - } - }, - - fixDependencies: function (data, strict) { - objectifyDeps(data, this.warn) - addOptionalDepsToDeps(data, this.warn) - this.fixBundleDependenciesField(data) - - ;['dependencies', 'devDependencies'].forEach(function (deps) { - if (!(deps in data)) { - return - } - if (!data[deps] || typeof data[deps] !== 'object') { - this.warn('nonObjectDependencies', deps) - delete data[deps] - return - } - Object.keys(data[deps]).forEach(function (d) { - var r = data[deps][d] - if (typeof r !== 'string') { - this.warn('nonStringDependency', d, JSON.stringify(r)) - delete data[deps][d] - } - var hosted = hostedGitInfo.fromUrl(data[deps][d]) - if (hosted) { - data[deps][d] = hosted.toString() - } - }, this) - }, this) - }, - - fixModulesField: function (data) { - if (data.modules) { - this.warn('deprecatedModules') - delete data.modules - } - }, - - fixKeywordsField: function (data) { - if (typeof data.keywords === 'string') { - data.keywords = data.keywords.split(/,\s+/) - } - if (data.keywords && !Array.isArray(data.keywords)) { - delete data.keywords - this.warn('nonArrayKeywords') - } else if (data.keywords) { - data.keywords = data.keywords.filter(function (kw) { - if (typeof kw !== 'string' || !kw) { - this.warn('nonStringKeyword') - return false - } else { - return true - } - }, this) - } - }, - - fixVersionField: function (data, strict) { - // allow "loose" semver 1.0 versions in non-strict mode - // enforce strict semver 2.0 compliance in strict mode - var loose = !strict - if (!data.version) { - data.version = '' - return true - } - if (!isValidSemver(data.version, loose)) { - throw new Error('Invalid version: "' + data.version + '"') - } - data.version = cleanSemver(data.version, loose) - return true - }, - - fixPeople: function (data) { - modifyPeople(data, unParsePerson) - modifyPeople(data, parsePerson) - }, - - fixNameField: function (data, options) { - if (typeof options === 'boolean') { - options = { strict: options } - } else if (typeof options === 'undefined') { - options = {} - } - var strict = options.strict - if (!data.name && !strict) { - data.name = '' - return - } - if (typeof data.name !== 'string') { - throw new Error('name field must be a string.') - } - if (!strict) { - data.name = data.name.trim() - } - ensureValidName(data.name, strict, options.allowLegacyCase) - if (isBuiltinModule(data.name)) { - this.warn('conflictingName', data.name) - } - }, - - fixDescriptionField: function (data) { - if (data.description && typeof data.description !== 'string') { - this.warn('nonStringDescription') - delete data.description - } - if (data.readme && !data.description) { - data.description = extractDescription(data.readme) - } - if (data.description === undefined) { - delete data.description - } - if (!data.description) { - this.warn('missingDescription') - } - }, - - fixReadmeField: function (data) { - if (!data.readme) { - this.warn('missingReadme') - data.readme = 'ERROR: No README data found!' - } - }, - - fixBugsField: function (data) { - if (!data.bugs && data.repository && data.repository.url) { - var hosted = hostedGitInfo.fromUrl(data.repository.url) - if (hosted && hosted.bugs()) { - data.bugs = { url: hosted.bugs() } - } - } else if (data.bugs) { - if (typeof data.bugs === 'string') { - if (isEmail(data.bugs)) { - data.bugs = { email: data.bugs } - /* eslint-disable-next-line node/no-deprecated-api */ - } else if (url.parse(data.bugs).protocol) { - data.bugs = { url: data.bugs } - } else { - this.warn('nonEmailUrlBugsString') - } - } else { - bugsTypos(data.bugs, this.warn) - var oldBugs = data.bugs - data.bugs = {} - if (oldBugs.url) { - /* eslint-disable-next-line node/no-deprecated-api */ - if (typeof (oldBugs.url) === 'string' && url.parse(oldBugs.url).protocol) { - data.bugs.url = oldBugs.url - } else { - this.warn('nonUrlBugsUrlField') - } - } - if (oldBugs.email) { - if (typeof (oldBugs.email) === 'string' && isEmail(oldBugs.email)) { - data.bugs.email = oldBugs.email - } else { - this.warn('nonEmailBugsEmailField') - } - } - } - if (!data.bugs.email && !data.bugs.url) { - delete data.bugs - this.warn('emptyNormalizedBugs') - } - } - }, - - fixHomepageField: function (data) { - if (!data.homepage && data.repository && data.repository.url) { - var hosted = hostedGitInfo.fromUrl(data.repository.url) - if (hosted && hosted.docs()) { - data.homepage = hosted.docs() - } - } - if (!data.homepage) { - return - } - - if (typeof data.homepage !== 'string') { - this.warn('nonUrlHomepage') - return delete data.homepage - } - /* eslint-disable-next-line node/no-deprecated-api */ - if (!url.parse(data.homepage).protocol) { - data.homepage = 'http://' + data.homepage - } - }, - - fixLicenseField: function (data) { - const license = data.license || data.licence - if (!license) { - return this.warn('missingLicense') - } - if ( - typeof (license) !== 'string' || - license.length < 1 || - license.trim() === '' - ) { - return this.warn('invalidLicense') - } - if (!validateLicense(license).validForNewPackages) { - return this.warn('invalidLicense') - } - }, -} - -function isValidScopedPackageName (spec) { - if (spec.charAt(0) !== '@') { - return false - } - - var rest = spec.slice(1).split('/') - if (rest.length !== 2) { - return false - } - - return rest[0] && rest[1] && - rest[0] === encodeURIComponent(rest[0]) && - rest[1] === encodeURIComponent(rest[1]) -} - -function isCorrectlyEncodedName (spec) { - return !spec.match(/[/@\s+%:]/) && - spec === encodeURIComponent(spec) -} - -function ensureValidName (name, strict, allowLegacyCase) { - if (name.charAt(0) === '.' || - !(isValidScopedPackageName(name) || isCorrectlyEncodedName(name)) || - (strict && (!allowLegacyCase) && name !== name.toLowerCase()) || - name.toLowerCase() === 'node_modules' || - name.toLowerCase() === 'favicon.ico') { - throw new Error('Invalid name: ' + JSON.stringify(name)) - } -} - -function modifyPeople (data, fn) { - if (data.author) { - data.author = fn(data.author) - }['maintainers', 'contributors'].forEach(function (set) { - if (!Array.isArray(data[set])) { - return - } - data[set] = data[set].map(fn) - }) - return data -} - -function unParsePerson (person) { - if (typeof person === 'string') { - return person - } - var name = person.name || '' - var u = person.url || person.web - var wrappedUrl = u ? (' (' + u + ')') : '' - var e = person.email || person.mail - var wrappedEmail = e ? (' <' + e + '>') : '' - return name + wrappedEmail + wrappedUrl -} - -function parsePerson (person) { - if (typeof person !== 'string') { - return person - } - var matchedName = person.match(/^([^(<]+)/) - var matchedUrl = person.match(/\(([^()]+)\)/) - var matchedEmail = person.match(/<([^<>]+)>/) - var obj = {} - if (matchedName && matchedName[0].trim()) { - obj.name = matchedName[0].trim() - } - if (matchedEmail) { - obj.email = matchedEmail[1] - } - if (matchedUrl) { - obj.url = matchedUrl[1] - } - return obj -} - -function addOptionalDepsToDeps (data, warn) { - var o = data.optionalDependencies - if (!o) { - return - } - var d = data.dependencies || {} - Object.keys(o).forEach(function (k) { - d[k] = o[k] - }) - data.dependencies = d -} - -function depObjectify (deps, type, warn) { - if (!deps) { - return {} - } - if (typeof deps === 'string') { - deps = deps.trim().split(/[\n\r\s\t ,]+/) - } - if (!Array.isArray(deps)) { - return deps - } - warn('deprecatedArrayDependencies', type) - var o = {} - deps.filter(function (d) { - return typeof d === 'string' - }).forEach(function (d) { - d = d.trim().split(/(:?[@\s><=])/) - var dn = d.shift() - var dv = d.join('') - dv = dv.trim() - dv = dv.replace(/^@/, '') - o[dn] = dv - }) - return o -} - -function objectifyDeps (data, warn) { - depTypes.forEach(function (type) { - if (!data[type]) { - return - } - data[type] = depObjectify(data[type], type, warn) - }) -} - -function bugsTypos (bugs, warn) { - if (!bugs) { - return - } - Object.keys(bugs).forEach(function (k) { - if (typos.bugs[k]) { - warn('typo', k, typos.bugs[k], 'bugs') - bugs[typos.bugs[k]] = bugs[k] - delete bugs[k] - } - }) -} - - -/***/ }), - -/***/ 9671: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -var util = __nccwpck_require__(3837) -var messages = __nccwpck_require__(6271) - -module.exports = function () { - var args = Array.prototype.slice.call(arguments, 0) - var warningName = args.shift() - if (warningName === 'typo') { - return makeTypoWarning.apply(null, args) - } else { - var msgTemplate = messages[warningName] ? messages[warningName] : warningName + ": '%s'" - args.unshift(msgTemplate) - return util.format.apply(null, args) - } -} - -function makeTypoWarning (providedName, probableName, field) { - if (field) { - providedName = field + "['" + providedName + "']" - probableName = field + "['" + probableName + "']" - } - return util.format(messages.typo, providedName, probableName) -} - - -/***/ }), - -/***/ 3188: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -module.exports = normalize - -var fixer = __nccwpck_require__(3492) -normalize.fixer = fixer - -var makeWarning = __nccwpck_require__(9671) - -var fieldsToFix = ['name', 'version', 'description', 'repository', 'modules', 'scripts', - 'files', 'bin', 'man', 'bugs', 'keywords', 'readme', 'homepage', 'license'] -var otherThingsToFix = ['dependencies', 'people', 'typos'] - -var thingsToFix = fieldsToFix.map(function (fieldName) { - return ucFirst(fieldName) + 'Field' -}) -// two ways to do this in CoffeeScript on only one line, sub-70 chars: -// thingsToFix = fieldsToFix.map (name) -> ucFirst(name) + "Field" -// thingsToFix = (ucFirst(name) + "Field" for name in fieldsToFix) -thingsToFix = thingsToFix.concat(otherThingsToFix) - -function normalize (data, warn, strict) { - if (warn === true) { - warn = null - strict = true - } - if (!strict) { - strict = false - } - if (!warn || data.private) { - warn = function (msg) { /* noop */ } - } - - if (data.scripts && - data.scripts.install === 'node-gyp rebuild' && - !data.scripts.preinstall) { - data.gypfile = true - } - fixer.warn = function () { - warn(makeWarning.apply(null, arguments)) - } - thingsToFix.forEach(function (thingName) { - fixer['fix' + ucFirst(thingName)](data, strict) - }) - data._id = data.name + '@' + data.version -} - -function ucFirst (string) { - return string.charAt(0).toUpperCase() + string.slice(1) -} - - -/***/ }), - -/***/ 6293: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -// pass in a manifest with a 'bin' field here, and it'll turn it -// into a properly santized bin object -const { join, basename } = __nccwpck_require__(1017) - -const normalize = pkg => - !pkg.bin ? removeBin(pkg) - : typeof pkg.bin === 'string' ? normalizeString(pkg) - : Array.isArray(pkg.bin) ? normalizeArray(pkg) - : typeof pkg.bin === 'object' ? normalizeObject(pkg) - : removeBin(pkg) - -const normalizeString = pkg => { - if (!pkg.name) { - return removeBin(pkg) - } - pkg.bin = { [pkg.name]: pkg.bin } - return normalizeObject(pkg) -} - -const normalizeArray = pkg => { - pkg.bin = pkg.bin.reduce((acc, k) => { - acc[basename(k)] = k - return acc - }, {}) - return normalizeObject(pkg) -} - -const removeBin = pkg => { - delete pkg.bin - return pkg -} - -const normalizeObject = pkg => { - const orig = pkg.bin - const clean = {} - let hasBins = false - Object.keys(orig).forEach(binKey => { - const base = join('/', basename(binKey.replace(/\\|:/g, '/'))).slice(1) - - if (typeof orig[binKey] !== 'string' || !base) { - return - } - - const binTarget = join('/', orig[binKey].replace(/\\/g, '/')) - .replace(/\\/g, '/').slice(1) - - if (!binTarget) { - return - } - - clean[base] = binTarget - hasBins = true - }) - - if (hasBins) { - pkg.bin = clean - } else { - delete pkg.bin - } - - return pkg -} - -module.exports = normalize - - -/***/ }), - -/***/ 2057: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - - -// Walk through the file-system "database" of installed -// packages, and create a data object related to the -// installed versions of each package. - -/* -This will traverse through all node_modules folders, -resolving the dependencies object to the object corresponding to -the package that meets that dep, or just the version/range if -unmet. - -Assuming that you had this folder structure: - -/path/to -+-- package.json { name = "root" } -`-- node_modules - +-- foo {bar, baz, asdf} - | +-- node_modules - | +-- bar { baz } - | `-- baz - `-- asdf - -where "foo" depends on bar, baz, and asdf, bar depends on baz, -and bar and baz are bundled with foo, whereas "asdf" is at -the higher level (sibling to foo), you'd get this object structure: - -{ -, path: "/path/to" -, parent: null -, dependencies: - { foo : - { version: "1.2.3" - , path: "/path/to/node_modules/foo" - , parent: - , dependencies: - { bar: - { parent: - , path: "/path/to/node_modules/foo/node_modules/bar" - , version: "2.3.4" - , dependencies: { baz: } - } - , baz: { ... } - , asdf: - } - } - , asdf: { ... } - } -} - -Unmet deps are left as strings. -Extraneous deps are marked with extraneous:true -deps that don't meet a requirement are marked with invalid:true -deps that don't meet a peer requirement are marked with peerInvalid:true - -to READ(packagefolder, parentobj, name, reqver) -obj = read package.json -installed = ./node_modules/* -if parentobj is null, and no package.json - obj = {dependencies:{:ANY}} -deps = Object.keys(obj.dependencies) -obj.path = packagefolder -obj.parent = parentobj -if name, && obj.name !== name, obj.invalid = true -if reqver, && obj.version !satisfies reqver, obj.invalid = true -if !reqver && parentobj, obj.extraneous = true -for each folder in installed - obj.dependencies[folder] = READ(packagefolder+node_modules+folder, - obj, folder, obj.dependencies[folder]) -# walk tree to find unmet deps -for each dep in obj.dependencies not in installed - r = obj.parent - while r - if r.dependencies[dep] - if r.dependencies[dep].verion !satisfies obj.dependencies[dep] - WARN - r.dependencies[dep].invalid = true - obj.dependencies[dep] = r.dependencies[dep] - r = null - else r = r.parent -return obj - - -TODO: -1. Find unmet deps in parent directories, searching as node does up -as far as the left-most node_modules folder. -2. Ignore anything in node_modules that isn't a package folder. - -*/ - -try { - var fs = __nccwpck_require__(7758) -} catch (er) { - var fs = __nccwpck_require__(7147) -} - -var path = __nccwpck_require__(1017) -var asyncMap = (__nccwpck_require__(6029).asyncMap) -var semver = __nccwpck_require__(1383) -var readJson = __nccwpck_require__(4086) - -var debug = __nccwpck_require__(8237)("read-installed") - -var { readdirScoped } = __nccwpck_require__(575) - -// Sentinel catch-all version constraint used when a dependency is not -// listed in the package.json file. -var ANY = {} - -module.exports = readInstalled - -function readInstalled (folder, opts, cb) { - if (typeof opts === 'function') { - cb = opts - opts = {} - } else { - opts = Object.assign({}, opts) - } - - if (typeof opts.depth !== 'number') - opts.depth = Infinity - - opts.depth = Math.max(0, opts.depth) + opts.depth = Math.max(0, opts.depth) if (typeof opts.log !== 'function') opts.log = function () {} @@ -13206,6 +13131,8 @@ const Range = __nccwpck_require__(9828) /***/ 9828: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +const SPACE_CHARACTERS = /\s+/g + // hoisted class for cyclic dependency class Range { constructor (range, options) { @@ -13226,7 +13153,7 @@ class Range { // just put it in the set and return this.raw = range.value this.set = [[range]] - this.format() + this.formatted = undefined return this } @@ -13237,10 +13164,7 @@ class Range { // First reduce all whitespace as much as possible so we do not have to rely // on potentially slow regexes like \s*. This is then stored and used for // future error messages as well. - this.raw = range - .trim() - .split(/\s+/) - .join(' ') + this.raw = range.trim().replace(SPACE_CHARACTERS, ' ') // First, split on || this.set = this.raw @@ -13274,14 +13198,29 @@ class Range { } } - this.format() + this.formatted = undefined + } + + get range () { + if (this.formatted === undefined) { + this.formatted = '' + for (let i = 0; i < this.set.length; i++) { + if (i > 0) { + this.formatted += '||' + } + const comps = this.set[i] + for (let k = 0; k < comps.length; k++) { + if (k > 0) { + this.formatted += ' ' + } + this.formatted += comps[k].toString().trim() + } + } + } + return this.formatted } format () { - this.range = this.set - .map((comps) => comps.join(' ').trim()) - .join('||') - .trim() return this.range } @@ -39314,652 +39253,6 @@ module.exports = { } -/***/ }), - -/***/ 5840: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -Object.defineProperty(exports, "v1", ({ - enumerable: true, - get: function () { - return _v.default; - } -})); -Object.defineProperty(exports, "v3", ({ - enumerable: true, - get: function () { - return _v2.default; - } -})); -Object.defineProperty(exports, "v4", ({ - enumerable: true, - get: function () { - return _v3.default; - } -})); -Object.defineProperty(exports, "v5", ({ - enumerable: true, - get: function () { - return _v4.default; - } -})); -Object.defineProperty(exports, "NIL", ({ - enumerable: true, - get: function () { - return _nil.default; - } -})); -Object.defineProperty(exports, "version", ({ - enumerable: true, - get: function () { - return _version.default; - } -})); -Object.defineProperty(exports, "validate", ({ - enumerable: true, - get: function () { - return _validate.default; - } -})); -Object.defineProperty(exports, "stringify", ({ - enumerable: true, - get: function () { - return _stringify.default; - } -})); -Object.defineProperty(exports, "parse", ({ - enumerable: true, - get: function () { - return _parse.default; - } -})); - -var _v = _interopRequireDefault(__nccwpck_require__(8628)); - -var _v2 = _interopRequireDefault(__nccwpck_require__(6409)); - -var _v3 = _interopRequireDefault(__nccwpck_require__(5122)); - -var _v4 = _interopRequireDefault(__nccwpck_require__(9120)); - -var _nil = _interopRequireDefault(__nccwpck_require__(5332)); - -var _version = _interopRequireDefault(__nccwpck_require__(1595)); - -var _validate = _interopRequireDefault(__nccwpck_require__(6900)); - -var _stringify = _interopRequireDefault(__nccwpck_require__(8950)); - -var _parse = _interopRequireDefault(__nccwpck_require__(2746)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/***/ }), - -/***/ 4569: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; - -var _crypto = _interopRequireDefault(__nccwpck_require__(6113)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function md5(bytes) { - if (Array.isArray(bytes)) { - bytes = Buffer.from(bytes); - } else if (typeof bytes === 'string') { - bytes = Buffer.from(bytes, 'utf8'); - } - - return _crypto.default.createHash('md5').update(bytes).digest(); -} - -var _default = md5; -exports["default"] = _default; - -/***/ }), - -/***/ 5332: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; -var _default = '00000000-0000-0000-0000-000000000000'; -exports["default"] = _default; - -/***/ }), - -/***/ 2746: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; - -var _validate = _interopRequireDefault(__nccwpck_require__(6900)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function parse(uuid) { - if (!(0, _validate.default)(uuid)) { - throw TypeError('Invalid UUID'); - } - - let v; - const arr = new Uint8Array(16); // Parse ########-....-....-....-............ - - arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24; - arr[1] = v >>> 16 & 0xff; - arr[2] = v >>> 8 & 0xff; - arr[3] = v & 0xff; // Parse ........-####-....-....-............ - - arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8; - arr[5] = v & 0xff; // Parse ........-....-####-....-............ - - arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8; - arr[7] = v & 0xff; // Parse ........-....-....-####-............ - - arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8; - arr[9] = v & 0xff; // Parse ........-....-....-....-############ - // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes) - - arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff; - arr[11] = v / 0x100000000 & 0xff; - arr[12] = v >>> 24 & 0xff; - arr[13] = v >>> 16 & 0xff; - arr[14] = v >>> 8 & 0xff; - arr[15] = v & 0xff; - return arr; -} - -var _default = parse; -exports["default"] = _default; - -/***/ }), - -/***/ 814: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; -var _default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i; -exports["default"] = _default; - -/***/ }), - -/***/ 807: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = rng; - -var _crypto = _interopRequireDefault(__nccwpck_require__(6113)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate - -let poolPtr = rnds8Pool.length; - -function rng() { - if (poolPtr > rnds8Pool.length - 16) { - _crypto.default.randomFillSync(rnds8Pool); - - poolPtr = 0; - } - - return rnds8Pool.slice(poolPtr, poolPtr += 16); -} - -/***/ }), - -/***/ 5274: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; - -var _crypto = _interopRequireDefault(__nccwpck_require__(6113)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function sha1(bytes) { - if (Array.isArray(bytes)) { - bytes = Buffer.from(bytes); - } else if (typeof bytes === 'string') { - bytes = Buffer.from(bytes, 'utf8'); - } - - return _crypto.default.createHash('sha1').update(bytes).digest(); -} - -var _default = sha1; -exports["default"] = _default; - -/***/ }), - -/***/ 8950: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; - -var _validate = _interopRequireDefault(__nccwpck_require__(6900)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Convert array of 16 byte values to UUID string format of the form: - * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX - */ -const byteToHex = []; - -for (let i = 0; i < 256; ++i) { - byteToHex.push((i + 0x100).toString(16).substr(1)); -} - -function stringify(arr, offset = 0) { - // Note: Be careful editing this code! It's been tuned for performance - // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434 - const uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one - // of the following: - // - One or more input array values don't map to a hex octet (leading to - // "undefined" in the uuid) - // - Invalid input values for the RFC `version` or `variant` fields - - if (!(0, _validate.default)(uuid)) { - throw TypeError('Stringified UUID is invalid'); - } - - return uuid; -} - -var _default = stringify; -exports["default"] = _default; - -/***/ }), - -/***/ 8628: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; - -var _rng = _interopRequireDefault(__nccwpck_require__(807)); - -var _stringify = _interopRequireDefault(__nccwpck_require__(8950)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// **`v1()` - Generate time-based UUID** -// -// Inspired by https://github.com/LiosK/UUID.js -// and http://docs.python.org/library/uuid.html -let _nodeId; - -let _clockseq; // Previous uuid creation time - - -let _lastMSecs = 0; -let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details - -function v1(options, buf, offset) { - let i = buf && offset || 0; - const b = buf || new Array(16); - options = options || {}; - let node = options.node || _nodeId; - let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not - // specified. We do this lazily to minimize issues related to insufficient - // system entropy. See #189 - - if (node == null || clockseq == null) { - const seedBytes = options.random || (options.rng || _rng.default)(); - - if (node == null) { - // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) - node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]]; - } - - if (clockseq == null) { - // Per 4.2.2, randomize (14 bit) clockseq - clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff; - } - } // UUID timestamps are 100 nano-second units since the Gregorian epoch, - // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so - // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' - // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. - - - let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock - // cycle to simulate higher resolution clock - - let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs) - - const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression - - if (dt < 0 && options.clockseq === undefined) { - clockseq = clockseq + 1 & 0x3fff; - } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new - // time interval - - - if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) { - nsecs = 0; - } // Per 4.2.1.2 Throw error if too many uuids are requested - - - if (nsecs >= 10000) { - throw new Error("uuid.v1(): Can't create more than 10M uuids/sec"); - } - - _lastMSecs = msecs; - _lastNSecs = nsecs; - _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch - - msecs += 12219292800000; // `time_low` - - const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; - b[i++] = tl >>> 24 & 0xff; - b[i++] = tl >>> 16 & 0xff; - b[i++] = tl >>> 8 & 0xff; - b[i++] = tl & 0xff; // `time_mid` - - const tmh = msecs / 0x100000000 * 10000 & 0xfffffff; - b[i++] = tmh >>> 8 & 0xff; - b[i++] = tmh & 0xff; // `time_high_and_version` - - b[i++] = tmh >>> 24 & 0xf | 0x10; // include version - - b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) - - b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low` - - b[i++] = clockseq & 0xff; // `node` - - for (let n = 0; n < 6; ++n) { - b[i + n] = node[n]; - } - - return buf || (0, _stringify.default)(b); -} - -var _default = v1; -exports["default"] = _default; - -/***/ }), - -/***/ 6409: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; - -var _v = _interopRequireDefault(__nccwpck_require__(5998)); - -var _md = _interopRequireDefault(__nccwpck_require__(4569)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -const v3 = (0, _v.default)('v3', 0x30, _md.default); -var _default = v3; -exports["default"] = _default; - -/***/ }), - -/***/ 5998: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = _default; -exports.URL = exports.DNS = void 0; - -var _stringify = _interopRequireDefault(__nccwpck_require__(8950)); - -var _parse = _interopRequireDefault(__nccwpck_require__(2746)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function stringToBytes(str) { - str = unescape(encodeURIComponent(str)); // UTF8 escape - - const bytes = []; - - for (let i = 0; i < str.length; ++i) { - bytes.push(str.charCodeAt(i)); - } - - return bytes; -} - -const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; -exports.DNS = DNS; -const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'; -exports.URL = URL; - -function _default(name, version, hashfunc) { - function generateUUID(value, namespace, buf, offset) { - if (typeof value === 'string') { - value = stringToBytes(value); - } - - if (typeof namespace === 'string') { - namespace = (0, _parse.default)(namespace); - } - - if (namespace.length !== 16) { - throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)'); - } // Compute hash of namespace and value, Per 4.3 - // Future: Use spread syntax when supported on all platforms, e.g. `bytes = - // hashfunc([...namespace, ... value])` - - - let bytes = new Uint8Array(16 + value.length); - bytes.set(namespace); - bytes.set(value, namespace.length); - bytes = hashfunc(bytes); - bytes[6] = bytes[6] & 0x0f | version; - bytes[8] = bytes[8] & 0x3f | 0x80; - - if (buf) { - offset = offset || 0; - - for (let i = 0; i < 16; ++i) { - buf[offset + i] = bytes[i]; - } - - return buf; - } - - return (0, _stringify.default)(bytes); - } // Function#name is not settable on some platforms (#270) - - - try { - generateUUID.name = name; // eslint-disable-next-line no-empty - } catch (err) {} // For CommonJS default export support - - - generateUUID.DNS = DNS; - generateUUID.URL = URL; - return generateUUID; -} - -/***/ }), - -/***/ 5122: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; - -var _rng = _interopRequireDefault(__nccwpck_require__(807)); - -var _stringify = _interopRequireDefault(__nccwpck_require__(8950)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function v4(options, buf, offset) { - options = options || {}; - - const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` - - - rnds[6] = rnds[6] & 0x0f | 0x40; - rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided - - if (buf) { - offset = offset || 0; - - for (let i = 0; i < 16; ++i) { - buf[offset + i] = rnds[i]; - } - - return buf; - } - - return (0, _stringify.default)(rnds); -} - -var _default = v4; -exports["default"] = _default; - -/***/ }), - -/***/ 9120: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; - -var _v = _interopRequireDefault(__nccwpck_require__(5998)); - -var _sha = _interopRequireDefault(__nccwpck_require__(5274)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -const v5 = (0, _v.default)('v5', 0x50, _sha.default); -var _default = v5; -exports["default"] = _default; - -/***/ }), - -/***/ 6900: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; - -var _regex = _interopRequireDefault(__nccwpck_require__(814)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function validate(uuid) { - return typeof uuid === 'string' && _regex.default.test(uuid); -} - -var _default = validate; -exports["default"] = _default; - -/***/ }), - -/***/ 1595: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports["default"] = void 0; - -var _validate = _interopRequireDefault(__nccwpck_require__(6900)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function version(uuid) { - if (!(0, _validate.default)(uuid)) { - throw TypeError('Invalid UUID'); - } - - return parseInt(uuid.substr(14, 1), 16); -} - -var _default = version; -exports["default"] = _default; - /***/ }), /***/ 2524: @@ -40079,6 +39372,14 @@ module.exports = require("buffer"); /***/ }), +/***/ 2081: +/***/ ((module) => { + +"use strict"; +module.exports = require("child_process"); + +/***/ }), + /***/ 6206: /***/ ((module) => { @@ -40287,6 +39588,14 @@ module.exports = require("string_decoder"); /***/ }), +/***/ 9512: +/***/ ((module) => { + +"use strict"; +module.exports = require("timers"); + +/***/ }), + /***/ 4404: /***/ ((module) => { @@ -41976,16 +41285,16 @@ module.exports = parseParams Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Glob = void 0; const minimatch_1 = __nccwpck_require__(4501); -const path_scurry_1 = __nccwpck_require__(1081); const node_url_1 = __nccwpck_require__(1041); +const path_scurry_1 = __nccwpck_require__(1081); const pattern_js_1 = __nccwpck_require__(6866); const walker_js_1 = __nccwpck_require__(153); // if no process global, just call it linux. // so we default to case-sensitive, / separators -const defaultPlatform = typeof process === 'object' && +const defaultPlatform = (typeof process === 'object' && process && - typeof process.platform === 'string' - ? process.platform + typeof process.platform === 'string') ? + process.platform : 'linux'; /** * An object that can perform glob pattern traversals. @@ -42015,6 +41324,7 @@ class Glob { signal; windowsPathsNoEscape; withFileTypes; + includeChildMatches; /** * The options provided to the constructor. */ @@ -42060,6 +41370,7 @@ class Glob { this.noext = !!opts.noext; this.realpath = !!opts.realpath; this.absolute = opts.absolute; + this.includeChildMatches = opts.includeChildMatches !== false; this.noglobstar = !!opts.noglobstar; this.matchBase = !!opts.matchBase; this.maxDepth = @@ -42074,7 +41385,8 @@ class Glob { } this.windowsPathsNoEscape = !!opts.windowsPathsNoEscape || - opts.allowWindowsEscape === false; + opts.allowWindowsEscape === + false; if (this.windowsPathsNoEscape) { pattern = pattern.map(p => p.replace(/\\/g, '/')); } @@ -42095,12 +41407,9 @@ class Glob { } } else { - const Scurry = opts.platform === 'win32' - ? path_scurry_1.PathScurryWin32 - : opts.platform === 'darwin' - ? path_scurry_1.PathScurryDarwin - : opts.platform - ? path_scurry_1.PathScurryPosix + const Scurry = opts.platform === 'win32' ? path_scurry_1.PathScurryWin32 + : opts.platform === 'darwin' ? path_scurry_1.PathScurryDarwin + : opts.platform ? path_scurry_1.PathScurryPosix : path_scurry_1.PathScurry; this.scurry = new Scurry(this.cwd, { nocase: opts.nocase, @@ -42152,11 +41461,12 @@ class Glob { return [ ...(await new walker_js_1.GlobWalker(this.patterns, this.scurry.cwd, { ...this.opts, - maxDepth: this.maxDepth !== Infinity - ? this.maxDepth + this.scurry.cwd.depth() + maxDepth: this.maxDepth !== Infinity ? + this.maxDepth + this.scurry.cwd.depth() : Infinity, platform: this.platform, nocase: this.nocase, + includeChildMatches: this.includeChildMatches, }).walk()), ]; } @@ -42164,32 +41474,35 @@ class Glob { return [ ...new walker_js_1.GlobWalker(this.patterns, this.scurry.cwd, { ...this.opts, - maxDepth: this.maxDepth !== Infinity - ? this.maxDepth + this.scurry.cwd.depth() + maxDepth: this.maxDepth !== Infinity ? + this.maxDepth + this.scurry.cwd.depth() : Infinity, platform: this.platform, nocase: this.nocase, + includeChildMatches: this.includeChildMatches, }).walkSync(), ]; } stream() { return new walker_js_1.GlobStream(this.patterns, this.scurry.cwd, { ...this.opts, - maxDepth: this.maxDepth !== Infinity - ? this.maxDepth + this.scurry.cwd.depth() + maxDepth: this.maxDepth !== Infinity ? + this.maxDepth + this.scurry.cwd.depth() : Infinity, platform: this.platform, nocase: this.nocase, + includeChildMatches: this.includeChildMatches, }).stream(); } streamSync() { return new walker_js_1.GlobStream(this.patterns, this.scurry.cwd, { ...this.opts, - maxDepth: this.maxDepth !== Infinity - ? this.maxDepth + this.scurry.cwd.depth() + maxDepth: this.maxDepth !== Infinity ? + this.maxDepth + this.scurry.cwd.depth() : Infinity, platform: this.platform, nocase: this.nocase, + includeChildMatches: this.includeChildMatches, }).streamSync(); } /** @@ -42265,10 +41578,10 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Ignore = void 0; const minimatch_1 = __nccwpck_require__(4501); const pattern_js_1 = __nccwpck_require__(6866); -const defaultPlatform = typeof process === 'object' && +const defaultPlatform = (typeof process === 'object' && process && - typeof process.platform === 'string' - ? process.platform + typeof process.platform === 'string') ? + process.platform : 'linux'; /** * Class used to process ignored patterns @@ -42278,12 +41591,15 @@ class Ignore { relativeChildren; absolute; absoluteChildren; + platform; + mmopts; constructor(ignored, { nobrace, nocase, noext, noglobstar, platform = defaultPlatform, }) { this.relative = []; this.absolute = []; this.relativeChildren = []; this.absoluteChildren = []; - const mmopts = { + this.platform = platform; + this.mmopts = { dot: true, nobrace, nocase, @@ -42294,6 +41610,10 @@ class Ignore { nocomment: true, nonegate: true, }; + for (const ign of ignored) + this.add(ign); + } + add(ign) { // this is a little weird, but it gives us a clean set of optimized // minimatch matchers, without getting tripped up if one of them // ends in /** inside a brace section, and it's only inefficient at @@ -42306,36 +41626,34 @@ class Ignore { // for absolute-ness. // Yet another way, Minimatch could take an array of glob strings, and // a cwd option, and do the right thing. - for (const ign of ignored) { - const mm = new minimatch_1.Minimatch(ign, mmopts); - for (let i = 0; i < mm.set.length; i++) { - const parsed = mm.set[i]; - const globParts = mm.globParts[i]; - /* c8 ignore start */ - if (!parsed || !globParts) { - throw new Error('invalid pattern object'); - } - // strip off leading ./ portions - // https://github.com/isaacs/node-glob/issues/570 - while (parsed[0] === '.' && globParts[0] === '.') { - parsed.shift(); - globParts.shift(); - } - /* c8 ignore stop */ - const p = new pattern_js_1.Pattern(parsed, globParts, 0, platform); - const m = new minimatch_1.Minimatch(p.globString(), mmopts); - const children = globParts[globParts.length - 1] === '**'; - const absolute = p.isAbsolute(); + const mm = new minimatch_1.Minimatch(ign, this.mmopts); + for (let i = 0; i < mm.set.length; i++) { + const parsed = mm.set[i]; + const globParts = mm.globParts[i]; + /* c8 ignore start */ + if (!parsed || !globParts) { + throw new Error('invalid pattern object'); + } + // strip off leading ./ portions + // https://github.com/isaacs/node-glob/issues/570 + while (parsed[0] === '.' && globParts[0] === '.') { + parsed.shift(); + globParts.shift(); + } + /* c8 ignore stop */ + const p = new pattern_js_1.Pattern(parsed, globParts, 0, this.platform); + const m = new minimatch_1.Minimatch(p.globString(), this.mmopts); + const children = globParts[globParts.length - 1] === '**'; + const absolute = p.isAbsolute(); + if (absolute) + this.absolute.push(m); + else + this.relative.push(m); + if (children) { if (absolute) - this.absolute.push(m); + this.absoluteChildren.push(m); else - this.relative.push(m); - if (children) { - if (absolute) - this.absoluteChildren.push(m); - else - this.relativeChildren.push(m); - } + this.relativeChildren.push(m); } } } @@ -42379,33 +41697,42 @@ exports.Ignore = Ignore; "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.glob = exports.hasMagic = exports.Glob = exports.unescape = exports.escape = exports.sync = exports.iterate = exports.iterateSync = exports.stream = exports.streamSync = exports.globIterate = exports.globIterateSync = exports.globSync = exports.globStream = exports.globStreamSync = void 0; +exports.glob = exports.sync = exports.iterate = exports.iterateSync = exports.stream = exports.streamSync = exports.Ignore = exports.hasMagic = exports.Glob = exports.unescape = exports.escape = void 0; +exports.globStreamSync = globStreamSync; +exports.globStream = globStream; +exports.globSync = globSync; +exports.globIterateSync = globIterateSync; +exports.globIterate = globIterate; const minimatch_1 = __nccwpck_require__(4501); const glob_js_1 = __nccwpck_require__(2487); const has_magic_js_1 = __nccwpck_require__(3133); +var minimatch_2 = __nccwpck_require__(4501); +Object.defineProperty(exports, "escape", ({ enumerable: true, get: function () { return minimatch_2.escape; } })); +Object.defineProperty(exports, "unescape", ({ enumerable: true, get: function () { return minimatch_2.unescape; } })); +var glob_js_2 = __nccwpck_require__(2487); +Object.defineProperty(exports, "Glob", ({ enumerable: true, get: function () { return glob_js_2.Glob; } })); +var has_magic_js_2 = __nccwpck_require__(3133); +Object.defineProperty(exports, "hasMagic", ({ enumerable: true, get: function () { return has_magic_js_2.hasMagic; } })); +var ignore_js_1 = __nccwpck_require__(9703); +Object.defineProperty(exports, "Ignore", ({ enumerable: true, get: function () { return ignore_js_1.Ignore; } })); function globStreamSync(pattern, options = {}) { return new glob_js_1.Glob(pattern, options).streamSync(); } -exports.globStreamSync = globStreamSync; function globStream(pattern, options = {}) { return new glob_js_1.Glob(pattern, options).stream(); } -exports.globStream = globStream; function globSync(pattern, options = {}) { return new glob_js_1.Glob(pattern, options).walkSync(); } -exports.globSync = globSync; async function glob_(pattern, options = {}) { return new glob_js_1.Glob(pattern, options).walk(); } function globIterateSync(pattern, options = {}) { return new glob_js_1.Glob(pattern, options).iterateSync(); } -exports.globIterateSync = globIterateSync; function globIterate(pattern, options = {}) { return new glob_js_1.Glob(pattern, options).iterate(); } -exports.globIterate = globIterate; // aliases: glob.sync.stream() glob.stream.sync() glob.sync() etc exports.streamSync = globStreamSync; exports.stream = Object.assign(globStream, { sync: globStreamSync }); @@ -42417,15 +41744,6 @@ exports.sync = Object.assign(globSync, { stream: globStreamSync, iterate: globIterateSync, }); -/* c8 ignore start */ -var minimatch_2 = __nccwpck_require__(4501); -Object.defineProperty(exports, "escape", ({ enumerable: true, get: function () { return minimatch_2.escape; } })); -Object.defineProperty(exports, "unescape", ({ enumerable: true, get: function () { return minimatch_2.unescape; } })); -var glob_js_2 = __nccwpck_require__(2487); -Object.defineProperty(exports, "Glob", ({ enumerable: true, get: function () { return glob_js_2.Glob; } })); -var has_magic_js_2 = __nccwpck_require__(3133); -Object.defineProperty(exports, "hasMagic", ({ enumerable: true, get: function () { return has_magic_js_2.hasMagic; } })); -/* c8 ignore stop */ exports.glob = Object.assign(glob_, { glob: glob_, globSync, @@ -42564,9 +41882,9 @@ class Pattern { globString() { return (this.#globString = this.#globString || - (this.#index === 0 - ? this.isAbsolute() - ? this.#globList[0] + this.#globList.slice(1).join('/') + (this.#index === 0 ? + this.isAbsolute() ? + this.#globList[0] + this.#globList.slice(1).join('/') : this.#globList.join('/') : this.#globList.slice(this.#index).join('/'))); } @@ -42595,8 +41913,8 @@ class Pattern { */ isUNC() { const pl = this.#patternList; - return this.#isUNC !== undefined - ? this.#isUNC + return this.#isUNC !== undefined ? + this.#isUNC : (this.#isUNC = this.#platform === 'win32' && this.#index === 0 && @@ -42617,8 +41935,8 @@ class Pattern { */ isDrive() { const pl = this.#patternList; - return this.#isDrive !== undefined - ? this.#isDrive + return this.#isDrive !== undefined ? + this.#isDrive : (this.#isDrive = this.#platform === 'win32' && this.#index === 0 && @@ -42634,8 +41952,8 @@ class Pattern { */ isAbsolute() { const pl = this.#patternList; - return this.#isAbsolute !== undefined - ? this.#isAbsolute + return this.#isAbsolute !== undefined ? + this.#isAbsolute : (this.#isAbsolute = (pl[0] === '' && pl.length > 1) || this.isDrive() || @@ -42646,8 +41964,8 @@ class Pattern { */ root() { const p = this.#patternList[0]; - return typeof p === 'string' && this.isAbsolute() && this.#index === 0 - ? p + return (typeof p === 'string' && this.isAbsolute() && this.#index === 0) ? + p : ''; } /** @@ -42783,9 +42101,8 @@ class Processor { this.opts = opts; this.follow = !!opts.follow; this.dot = !!opts.dot; - this.hasWalkedCache = hasWalkedCache - ? hasWalkedCache.copy() - : new HasWalkedCache(); + this.hasWalkedCache = + hasWalkedCache ? hasWalkedCache.copy() : new HasWalkedCache(); } processPatterns(target, patterns) { this.patterns = patterns; @@ -42798,8 +42115,8 @@ class Processor { const absolute = pattern.isAbsolute() && this.opts.absolute !== false; // start absolute patterns at root if (root) { - t = t.resolve(root === '/' && this.opts.root !== undefined - ? this.opts.root + t = t.resolve(root === '/' && this.opts.root !== undefined ? + this.opts.root : root); const rest = pattern.rest(); if (!rest) { @@ -42999,10 +42316,8 @@ exports.GlobStream = exports.GlobWalker = exports.GlobUtil = void 0; const minipass_1 = __nccwpck_require__(4968); const ignore_js_1 = __nccwpck_require__(9703); const processor_js_1 = __nccwpck_require__(4628); -const makeIgnore = (ignore, opts) => typeof ignore === 'string' - ? new ignore_js_1.Ignore([ignore], opts) - : Array.isArray(ignore) - ? new ignore_js_1.Ignore(ignore, opts) +const makeIgnore = (ignore, opts) => typeof ignore === 'string' ? new ignore_js_1.Ignore([ignore], opts) + : Array.isArray(ignore) ? new ignore_js_1.Ignore(ignore, opts) : ignore; /** * basic walking utilities that all the glob walker types use @@ -43019,13 +42334,20 @@ class GlobUtil { #sep; signal; maxDepth; + includeChildMatches; constructor(patterns, path, opts) { this.patterns = patterns; this.path = path; this.opts = opts; this.#sep = !opts.posix && opts.platform === 'win32' ? '\\' : '/'; - if (opts.ignore) { - this.#ignore = makeIgnore(opts.ignore, opts); + this.includeChildMatches = opts.includeChildMatches !== false; + if (opts.ignore || !this.includeChildMatches) { + this.#ignore = makeIgnore(opts.ignore ?? [], opts); + if (!this.includeChildMatches && + typeof this.#ignore.add !== 'function') { + const m = 'cannot ignore child matches, ignore lacks add() method.'; + throw new Error(m); + } } // ignore, always set with maxDepth, but it's optional on the // GlobOptions type @@ -43097,7 +42419,7 @@ class GlobUtil { return this.matchCheckTest(s, ifDir); } matchCheckTest(e, ifDir) { - return e && + return (e && (this.maxDepth === Infinity || e.depth() <= this.maxDepth) && (!ifDir || e.canReaddir()) && (!this.opts.nodir || !e.isDirectory()) && @@ -43105,8 +42427,8 @@ class GlobUtil { !this.opts.follow || !e.isSymbolicLink() || !e.realpathCached()?.isDirectory()) && - !this.#ignored(e) - ? e + !this.#ignored(e)) ? + e : undefined; } matchCheckSync(e, ifDir) { @@ -43132,6 +42454,11 @@ class GlobUtil { matchFinish(e, absolute) { if (this.#ignored(e)) return; + // we know we have an ignore if this is false, but TS doesn't + if (!this.includeChildMatches && this.#ignore?.add) { + const ign = `${e.relativePosix()}/**`; + this.#ignore.add(ign); + } const abs = this.opts.absolute === undefined ? absolute : this.opts.absolute; this.seen.add(e); const mark = this.opts.mark && e.isDirectory() ? this.#sep : ''; @@ -43145,8 +42472,8 @@ class GlobUtil { } else { const rel = this.opts.posix ? e.relativePosix() : e.relative(); - const pre = this.opts.dotRelative && !rel.startsWith('..' + this.#sep) - ? '.' + this.#sep + const pre = this.opts.dotRelative && !rel.startsWith('..' + this.#sep) ? + '.' + this.#sep : ''; this.matchEmit(!rel ? '.' + mark : pre + rel + mark); } @@ -43286,10 +42613,9 @@ class GlobUtil { } exports.GlobUtil = GlobUtil; class GlobWalker extends GlobUtil { - matches; + matches = new Set(); constructor(patterns, path, opts) { super(patterns, path, opts); - this.matches = new Set(); } matchEmit(e) { this.matches.add(e); @@ -44738,21 +44064,26 @@ class Stack { /** * Default export, the thing you're using this module to get. * - * All properties from the options object (with the exception of - * {@link OptionsBase.max} and {@link OptionsBase.maxSize}) are added as - * normal public members. (`max` and `maxBase` are read-only getters.) - * Changing any of these will alter the defaults for subsequent method calls, - * but is otherwise safe. + * The `K` and `V` types define the key and value types, respectively. The + * optional `FC` type defines the type of the `context` object passed to + * `cache.fetch()` and `cache.memo()`. + * + * Keys and values **must not** be `null` or `undefined`. + * + * All properties from the options object (with the exception of `max`, + * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are + * added as normal public members. (The listed options are read-only getters.) + * + * Changing any of these will alter the defaults for subsequent method calls. */ class LRUCache { - // properties coming in from the options of these, only max and maxSize - // really *need* to be protected. The rest can be modified, as they just - // set defaults for various methods. + // options that cannot be changed without disaster #max; #maxSize; #dispose; #disposeAfter; #fetchMethod; + #memoMethod; /** * {@link LRUCache.OptionsBase.ttl} */ @@ -44898,6 +44229,9 @@ class LRUCache { get fetchMethod() { return this.#fetchMethod; } + get memoMethod() { + return this.#memoMethod; + } /** * {@link LRUCache.OptionsBase.dispose} (read-only) */ @@ -44911,7 +44245,7 @@ class LRUCache { return this.#disposeAfter; } constructor(options) { - const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort, } = options; + const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort, } = options; if (max !== 0 && !isPosInt(max)) { throw new TypeError('max option must be a nonnegative integer'); } @@ -44931,6 +44265,11 @@ class LRUCache { throw new TypeError('sizeCalculation set to non-function'); } } + if (memoMethod !== undefined && + typeof memoMethod !== 'function') { + throw new TypeError('memoMethod must be a function if defined'); + } + this.#memoMethod = memoMethod; if (fetchMethod !== undefined && typeof fetchMethod !== 'function') { throw new TypeError('fetchMethod must be a function if specified'); @@ -45009,7 +44348,8 @@ class LRUCache { } } /** - * Return the remaining TTL time for a given entry key + * Return the number of ms left in the item's TTL. If item is not in cache, + * returns `0`. Returns `Infinity` if item is in cache without a defined TTL. */ getRemainingTTL(key) { return this.#keyMap.has(key) ? Infinity : 0; @@ -45025,7 +44365,7 @@ class LRUCache { if (ttl !== 0 && this.ttlAutopurge) { const t = setTimeout(() => { if (this.#isStale(index)) { - this.delete(this.#keyList[index]); + this.#delete(this.#keyList[index], 'expire'); } }, ttl + 1); // unref() not supported on all platforms @@ -45282,13 +44622,14 @@ class LRUCache { return this.entries(); } /** - * A String value that is used in the creation of the default string description of an object. - * Called by the built-in method Object.prototype.toString. + * A String value that is used in the creation of the default string + * description of an object. Called by the built-in method + * `Object.prototype.toString`. */ [Symbol.toStringTag] = 'LRUCache'; /** * Find a value for which the supplied fn method returns a truthy value, - * similar to Array.find(). fn is called as fn(value, key, cache). + * similar to `Array.find()`. fn is called as `fn(value, key, cache)`. */ find(fn, getOptions = {}) { for (const i of this.#indexes()) { @@ -45304,10 +44645,15 @@ class LRUCache { } } /** - * Call the supplied function on each item in the cache, in order from - * most recently used to least recently used. fn is called as - * fn(value, key, cache). Does not update age or recenty of use. - * Does not iterate over stale values. + * Call the supplied function on each item in the cache, in order from most + * recently used to least recently used. + * + * `fn` is called as `fn(value, key, cache)`. + * + * If `thisp` is provided, function will be called in the `this`-context of + * the provided object, or the cache if no `thisp` object is provided. + * + * Does not update age or recenty of use, or iterate over stale values. */ forEach(fn, thisp = this) { for (const i of this.#indexes()) { @@ -45343,7 +44689,7 @@ class LRUCache { let deleted = false; for (const i of this.#rindexes({ allowStale: true })) { if (this.#isStale(i)) { - this.delete(this.#keyList[i]); + this.#delete(this.#keyList[i], 'expire'); deleted = true; } } @@ -45351,9 +44697,15 @@ class LRUCache { } /** * Get the extended info about a given entry, to get its value, size, and - * TTL info simultaneously. Like {@link LRUCache#dump}, but just for a - * single key. Always returns stale values, if their info is found in the - * cache, so be sure to check for expired TTLs if relevant. + * TTL info simultaneously. Returns `undefined` if the key is not present. + * + * Unlike {@link LRUCache#dump}, which is designed to be portable and survive + * serialization, the `start` value is always the current timestamp, and the + * `ttl` is a calculated remaining time to live (negative if expired). + * + * Always returns stale values, if their info is found in the cache, so be + * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl}) + * if relevant. */ info(key) { const i = this.#keyMap.get(key); @@ -45382,7 +44734,16 @@ class LRUCache { } /** * Return an array of [key, {@link LRUCache.Entry}] tuples which can be - * passed to cache.load() + * passed to {@link LRLUCache#load}. + * + * The `start` fields are calculated relative to a portable `Date.now()` + * timestamp, even if `performance.now()` is available. + * + * Stale entries are always included in the `dump`, even if + * {@link LRUCache.OptionsBase.allowStale} is false. + * + * Note: this returns an actual array, not a generator, so it can be more + * easily passed around. */ dump() { const arr = []; @@ -45411,8 +44772,12 @@ class LRUCache { } /** * Reset the cache and load in the items in entries in the order listed. - * Note that the shape of the resulting cache may be different if the - * same options are not used in both caches. + * + * The shape of the resulting cache may be different if the same options are + * not used in both caches. + * + * The `start` fields are assumed to be calculated relative to a portable + * `Date.now()` timestamp, even if `performance.now()` is available. */ load(arr) { this.clear(); @@ -45435,6 +44800,30 @@ class LRUCache { * * Note: if `undefined` is specified as a value, this is an alias for * {@link LRUCache#delete} + * + * Fields on the {@link LRUCache.SetOptions} options param will override + * their corresponding values in the constructor options for the scope + * of this single `set()` operation. + * + * If `start` is provided, then that will set the effective start + * time for the TTL calculation. Note that this must be a previous + * value of `performance.now()` if supported, or a previous value of + * `Date.now()` if not. + * + * Options object may also include `size`, which will prevent + * calling the `sizeCalculation` function and just use the specified + * number if it is a positive integer, and `noDisposeOnSet` which + * will prevent calling a `dispose` function in the case of + * overwrites. + * + * If the `size` (or return value of `sizeCalculation`) for a given + * entry is greater than `maxEntrySize`, then the item will not be + * added to the cache. + * + * Will update the recency of the entry. + * + * If the value is `undefined`, then this is an alias for + * `cache.delete(key)`. `undefined` is never stored in the cache. */ set(k, v, setOptions = {}) { if (v === undefined) { @@ -45452,7 +44841,7 @@ class LRUCache { status.maxEntrySizeExceeded = true; } // have to delete, in case something is there already. - this.delete(k); + this.#delete(k, 'set'); return this; } let index = this.#size === 0 ? undefined : this.#keyMap.get(k); @@ -45604,6 +44993,14 @@ class LRUCache { * Will return false if the item is stale, even though it is technically * in the cache. * + * Check if a key is in the cache, without updating the recency of + * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set + * to `true` in either the options or the constructor. + * + * Will return `false` if the item is stale, even though it is technically in + * the cache. The difference can be determined (if it matters) by using a + * `status` argument, and inspecting the `has` field. + * * Will not update item age unless * {@link LRUCache.OptionsBase.updateAgeOnHas} is set. */ @@ -45695,7 +45092,7 @@ class LRUCache { this.#valList[index] = bf.__staleWhileFetching; } else { - this.delete(k); + this.#delete(k, 'fetch'); } } else { @@ -45724,7 +45121,7 @@ class LRUCache { // the stale value is not removed from the cache when the fetch fails. const del = !noDelete || bf.__staleWhileFetching === undefined; if (del) { - this.delete(k); + this.#delete(k, 'fetch'); } else if (!allowStaleAborted) { // still replace the *promise* with the stale value, @@ -45870,6 +45267,28 @@ class LRUCache { return staleVal ? p.__staleWhileFetching : (p.__returned = p); } } + async forceFetch(k, fetchOptions = {}) { + const v = await this.fetch(k, fetchOptions); + if (v === undefined) + throw new Error('fetch() returned undefined'); + return v; + } + memo(k, memoOptions = {}) { + const memoMethod = this.#memoMethod; + if (!memoMethod) { + throw new Error('no memoMethod provided to constructor'); + } + const { context, forceRefresh, ...options } = memoOptions; + const v = this.get(k, options); + if (!forceRefresh && v !== undefined) + return v; + const vv = memoMethod(k, v, { + options, + context, + }); + this.set(k, vv, options); + return vv; + } /** * Return a value from the cache. Will update the recency of the cache * entry found. @@ -45890,7 +45309,7 @@ class LRUCache { // delete only if not an in-flight background fetch if (!fetching) { if (!noDeleteOnStaleGet) { - this.delete(k); + this.#delete(k, 'expire'); } if (status && allowStale) status.returnedStale = true; @@ -45953,16 +45372,20 @@ class LRUCache { } /** * Deletes a key out of the cache. + * * Returns true if the key was deleted, false otherwise. */ delete(k) { + return this.#delete(k, 'delete'); + } + #delete(k, reason) { let deleted = false; if (this.#size !== 0) { const index = this.#keyMap.get(k); if (index !== undefined) { deleted = true; if (this.#size === 1) { - this.clear(); + this.#clear(reason); } else { this.#removeItemSize(index); @@ -45972,10 +45395,10 @@ class LRUCache { } else if (this.#hasDispose || this.#hasDisposeAfter) { if (this.#hasDispose) { - this.#dispose?.(v, k, 'delete'); + this.#dispose?.(v, k, reason); } if (this.#hasDisposeAfter) { - this.#disposed?.push([v, k, 'delete']); + this.#disposed?.push([v, k, reason]); } } this.#keyMap.delete(k); @@ -46011,6 +45434,9 @@ class LRUCache { * Clear the cache entirely, throwing away all values. */ clear() { + return this.#clear('delete'); + } + #clear(reason) { for (const index of this.#rindexes({ allowStale: true })) { const v = this.#valList[index]; if (this.#isBackgroundFetch(v)) { @@ -46019,10 +45445,10 @@ class LRUCache { else { const k = this.#keyList[index]; if (this.#hasDispose) { - this.#dispose?.(v, k, 'delete'); + this.#dispose?.(v, k, reason); } if (this.#hasDisposeAfter) { - this.#disposed?.push([v, k, 'delete']); + this.#disposed?.push([v, k, reason]); } } } @@ -47400,10 +46826,11 @@ class Minimatch { for (let i = 0; i < globParts.length - 1; i++) { for (let j = i + 1; j < globParts.length; j++) { const matched = this.partsMatch(globParts[i], globParts[j], !this.preserveMultipleSlashes); - if (!matched) - continue; - globParts[i] = matched; - globParts[j] = []; + if (matched) { + globParts[i] = []; + globParts[j] = matched; + break; + } } } return globParts.filter(gs => gs.length); @@ -49126,1850 +48553,3371 @@ const setAsCwd = Symbol('PathScurry setAsCwd'); */ class PathBase { /** - * the basename of this path + * the basename of this path + * + * **Important**: *always* test the path name against any test string + * usingthe {@link isNamed} method, and not by directly comparing this + * string. Otherwise, unicode path strings that the system sees as identical + * will not be properly treated as the same path, leading to incorrect + * behavior and possible security issues. + */ + name; + /** + * the Path entry corresponding to the path root. + * + * @internal + */ + root; + /** + * All roots found within the current PathScurry family + * + * @internal + */ + roots; + /** + * a reference to the parent path, or undefined in the case of root entries + * + * @internal + */ + parent; + /** + * boolean indicating whether paths are compared case-insensitively + * @internal + */ + nocase; + /** + * boolean indicating that this path is the current working directory + * of the PathScurry collection that contains it. + */ + isCWD = false; + // potential default fs override + #fs; + // Stats fields + #dev; + get dev() { + return this.#dev; + } + #mode; + get mode() { + return this.#mode; + } + #nlink; + get nlink() { + return this.#nlink; + } + #uid; + get uid() { + return this.#uid; + } + #gid; + get gid() { + return this.#gid; + } + #rdev; + get rdev() { + return this.#rdev; + } + #blksize; + get blksize() { + return this.#blksize; + } + #ino; + get ino() { + return this.#ino; + } + #size; + get size() { + return this.#size; + } + #blocks; + get blocks() { + return this.#blocks; + } + #atimeMs; + get atimeMs() { + return this.#atimeMs; + } + #mtimeMs; + get mtimeMs() { + return this.#mtimeMs; + } + #ctimeMs; + get ctimeMs() { + return this.#ctimeMs; + } + #birthtimeMs; + get birthtimeMs() { + return this.#birthtimeMs; + } + #atime; + get atime() { + return this.#atime; + } + #mtime; + get mtime() { + return this.#mtime; + } + #ctime; + get ctime() { + return this.#ctime; + } + #birthtime; + get birthtime() { + return this.#birthtime; + } + #matchName; + #depth; + #fullpath; + #fullpathPosix; + #relative; + #relativePosix; + #type; + #children; + #linkTarget; + #realpath; + /** + * This property is for compatibility with the Dirent class as of + * Node v20, where Dirent['parentPath'] refers to the path of the + * directory that was passed to readdir. For root entries, it's the path + * to the entry itself. + */ + get parentPath() { + return (this.parent || this).fullpath(); + } + /** + * Deprecated alias for Dirent['parentPath'] Somewhat counterintuitively, + * this property refers to the *parent* path, not the path object itself. + */ + get path() { + return this.parentPath; + } + /** + * Do not create new Path objects directly. They should always be accessed + * via the PathScurry class or other methods on the Path class. + * + * @internal + */ + constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) { + this.name = name; + this.#matchName = nocase ? normalizeNocase(name) : normalize(name); + this.#type = type & TYPEMASK; + this.nocase = nocase; + this.roots = roots; + this.root = root || this; + this.#children = children; + this.#fullpath = opts.fullpath; + this.#relative = opts.relative; + this.#relativePosix = opts.relativePosix; + this.parent = opts.parent; + if (this.parent) { + this.#fs = this.parent.#fs; + } + else { + this.#fs = fsFromOption(opts.fs); + } + } + /** + * Returns the depth of the Path object from its root. + * + * For example, a path at `/foo/bar` would have a depth of 2. + */ + depth() { + if (this.#depth !== undefined) + return this.#depth; + if (!this.parent) + return (this.#depth = 0); + return (this.#depth = this.parent.depth() + 1); + } + /** + * @internal + */ + childrenCache() { + return this.#children; + } + /** + * Get the Path object referenced by the string path, resolved from this Path + */ + resolve(path) { + if (!path) { + return this; + } + const rootPath = this.getRootString(path); + const dir = path.substring(rootPath.length); + const dirParts = dir.split(this.splitSep); + const result = rootPath ? + this.getRoot(rootPath).#resolveParts(dirParts) + : this.#resolveParts(dirParts); + return result; + } + #resolveParts(dirParts) { + let p = this; + for (const part of dirParts) { + p = p.child(part); + } + return p; + } + /** + * Returns the cached children Path objects, if still available. If they + * have fallen out of the cache, then returns an empty array, and resets the + * READDIR_CALLED bit, so that future calls to readdir() will require an fs + * lookup. + * + * @internal + */ + children() { + const cached = this.#children.get(this); + if (cached) { + return cached; + } + const children = Object.assign([], { provisional: 0 }); + this.#children.set(this, children); + this.#type &= ~READDIR_CALLED; + return children; + } + /** + * Resolves a path portion and returns or creates the child Path. + * + * Returns `this` if pathPart is `''` or `'.'`, or `parent` if pathPart is + * `'..'`. + * + * This should not be called directly. If `pathPart` contains any path + * separators, it will lead to unsafe undefined behavior. + * + * Use `Path.resolve()` instead. + * + * @internal + */ + child(pathPart, opts) { + if (pathPart === '' || pathPart === '.') { + return this; + } + if (pathPart === '..') { + return this.parent || this; + } + // find the child + const children = this.children(); + const name = this.nocase ? normalizeNocase(pathPart) : normalize(pathPart); + for (const p of children) { + if (p.#matchName === name) { + return p; + } + } + // didn't find it, create provisional child, since it might not + // actually exist. If we know the parent isn't a dir, then + // in fact it CAN'T exist. + const s = this.parent ? this.sep : ''; + const fullpath = this.#fullpath ? this.#fullpath + s + pathPart : undefined; + const pchild = this.newChild(pathPart, UNKNOWN, { + ...opts, + parent: this, + fullpath, + }); + if (!this.canReaddir()) { + pchild.#type |= ENOENT; + } + // don't have to update provisional, because if we have real children, + // then provisional is set to children.length, otherwise a lower number + children.push(pchild); + return pchild; + } + /** + * The relative path from the cwd. If it does not share an ancestor with + * the cwd, then this ends up being equivalent to the fullpath() + */ + relative() { + if (this.isCWD) + return ''; + if (this.#relative !== undefined) { + return this.#relative; + } + const name = this.name; + const p = this.parent; + if (!p) { + return (this.#relative = this.name); + } + const pv = p.relative(); + return pv + (!pv || !p.parent ? '' : this.sep) + name; + } + /** + * The relative path from the cwd, using / as the path separator. + * If it does not share an ancestor with + * the cwd, then this ends up being equivalent to the fullpathPosix() + * On posix systems, this is identical to relative(). + */ + relativePosix() { + if (this.sep === '/') + return this.relative(); + if (this.isCWD) + return ''; + if (this.#relativePosix !== undefined) + return this.#relativePosix; + const name = this.name; + const p = this.parent; + if (!p) { + return (this.#relativePosix = this.fullpathPosix()); + } + const pv = p.relativePosix(); + return pv + (!pv || !p.parent ? '' : '/') + name; + } + /** + * The fully resolved path string for this Path entry + */ + fullpath() { + if (this.#fullpath !== undefined) { + return this.#fullpath; + } + const name = this.name; + const p = this.parent; + if (!p) { + return (this.#fullpath = this.name); + } + const pv = p.fullpath(); + const fp = pv + (!p.parent ? '' : this.sep) + name; + return (this.#fullpath = fp); + } + /** + * On platforms other than windows, this is identical to fullpath. + * + * On windows, this is overridden to return the forward-slash form of the + * full UNC path. + */ + fullpathPosix() { + if (this.#fullpathPosix !== undefined) + return this.#fullpathPosix; + if (this.sep === '/') + return (this.#fullpathPosix = this.fullpath()); + if (!this.parent) { + const p = this.fullpath().replace(/\\/g, '/'); + if (/^[a-z]:\//i.test(p)) { + return (this.#fullpathPosix = `//?/${p}`); + } + else { + return (this.#fullpathPosix = p); + } + } + const p = this.parent; + const pfpp = p.fullpathPosix(); + const fpp = pfpp + (!pfpp || !p.parent ? '' : '/') + this.name; + return (this.#fullpathPosix = fpp); + } + /** + * Is the Path of an unknown type? * - * **Important**: *always* test the path name against any test string - * usingthe {@link isNamed} method, and not by directly comparing this - * string. Otherwise, unicode path strings that the system sees as identical - * will not be properly treated as the same path, leading to incorrect - * behavior and possible security issues. + * Note that we might know *something* about it if there has been a previous + * filesystem operation, for example that it does not exist, or is not a + * link, or whether it has child entries. */ - name; + isUnknown() { + return (this.#type & IFMT) === UNKNOWN; + } + isType(type) { + return this[`is${type}`](); + } + getType() { + return (this.isUnknown() ? 'Unknown' + : this.isDirectory() ? 'Directory' + : this.isFile() ? 'File' + : this.isSymbolicLink() ? 'SymbolicLink' + : this.isFIFO() ? 'FIFO' + : this.isCharacterDevice() ? 'CharacterDevice' + : this.isBlockDevice() ? 'BlockDevice' + : /* c8 ignore start */ this.isSocket() ? 'Socket' + : 'Unknown'); + /* c8 ignore stop */ + } /** - * the Path entry corresponding to the path root. - * - * @internal + * Is the Path a regular file? */ - root; + isFile() { + return (this.#type & IFMT) === IFREG; + } /** - * All roots found within the current PathScurry family - * - * @internal + * Is the Path a directory? */ - roots; + isDirectory() { + return (this.#type & IFMT) === IFDIR; + } /** - * a reference to the parent path, or undefined in the case of root entries - * - * @internal + * Is the path a character device? */ - parent; + isCharacterDevice() { + return (this.#type & IFMT) === IFCHR; + } /** - * boolean indicating whether paths are compared case-insensitively - * @internal + * Is the path a block device? */ - nocase; + isBlockDevice() { + return (this.#type & IFMT) === IFBLK; + } /** - * boolean indicating that this path is the current working directory - * of the PathScurry collection that contains it. + * Is the path a FIFO pipe? */ - isCWD = false; - // potential default fs override - #fs; - // Stats fields - #dev; - get dev() { - return this.#dev; - } - #mode; - get mode() { - return this.#mode; - } - #nlink; - get nlink() { - return this.#nlink; - } - #uid; - get uid() { - return this.#uid; - } - #gid; - get gid() { - return this.#gid; - } - #rdev; - get rdev() { - return this.#rdev; - } - #blksize; - get blksize() { - return this.#blksize; - } - #ino; - get ino() { - return this.#ino; - } - #size; - get size() { - return this.#size; - } - #blocks; - get blocks() { - return this.#blocks; + isFIFO() { + return (this.#type & IFMT) === IFIFO; } - #atimeMs; - get atimeMs() { - return this.#atimeMs; + /** + * Is the path a socket? + */ + isSocket() { + return (this.#type & IFMT) === IFSOCK; } - #mtimeMs; - get mtimeMs() { - return this.#mtimeMs; + /** + * Is the path a symbolic link? + */ + isSymbolicLink() { + return (this.#type & IFLNK) === IFLNK; } - #ctimeMs; - get ctimeMs() { - return this.#ctimeMs; + /** + * Return the entry if it has been subject of a successful lstat, or + * undefined otherwise. + * + * Does not read the filesystem, so an undefined result *could* simply + * mean that we haven't called lstat on it. + */ + lstatCached() { + return this.#type & LSTAT_CALLED ? this : undefined; } - #birthtimeMs; - get birthtimeMs() { - return this.#birthtimeMs; + /** + * Return the cached link target if the entry has been the subject of a + * successful readlink, or undefined otherwise. + * + * Does not read the filesystem, so an undefined result *could* just mean we + * don't have any cached data. Only use it if you are very sure that a + * readlink() has been called at some point. + */ + readlinkCached() { + return this.#linkTarget; } - #atime; - get atime() { - return this.#atime; + /** + * Returns the cached realpath target if the entry has been the subject + * of a successful realpath, or undefined otherwise. + * + * Does not read the filesystem, so an undefined result *could* just mean we + * don't have any cached data. Only use it if you are very sure that a + * realpath() has been called at some point. + */ + realpathCached() { + return this.#realpath; } - #mtime; - get mtime() { - return this.#mtime; + /** + * Returns the cached child Path entries array if the entry has been the + * subject of a successful readdir(), or [] otherwise. + * + * Does not read the filesystem, so an empty array *could* just mean we + * don't have any cached data. Only use it if you are very sure that a + * readdir() has been called recently enough to still be valid. + */ + readdirCached() { + const children = this.children(); + return children.slice(0, children.provisional); } - #ctime; - get ctime() { - return this.#ctime; + /** + * Return true if it's worth trying to readlink. Ie, we don't (yet) have + * any indication that readlink will definitely fail. + * + * Returns false if the path is known to not be a symlink, if a previous + * readlink failed, or if the entry does not exist. + */ + canReadlink() { + if (this.#linkTarget) + return true; + if (!this.parent) + return false; + // cases where it cannot possibly succeed + const ifmt = this.#type & IFMT; + return !((ifmt !== UNKNOWN && ifmt !== IFLNK) || + this.#type & ENOREADLINK || + this.#type & ENOENT); } - #birthtime; - get birthtime() { - return this.#birthtime; + /** + * Return true if readdir has previously been successfully called on this + * path, indicating that cachedReaddir() is likely valid. + */ + calledReaddir() { + return !!(this.#type & READDIR_CALLED); } - #matchName; - #depth; - #fullpath; - #fullpathPosix; - #relative; - #relativePosix; - #type; - #children; - #linkTarget; - #realpath; /** - * This property is for compatibility with the Dirent class as of - * Node v20, where Dirent['parentPath'] refers to the path of the - * directory that was passed to readdir. For root entries, it's the path - * to the entry itself. + * Returns true if the path is known to not exist. That is, a previous lstat + * or readdir failed to verify its existence when that would have been + * expected, or a parent entry was marked either enoent or enotdir. */ - get parentPath() { - return (this.parent || this).fullpath(); + isENOENT() { + return !!(this.#type & ENOENT); } /** - * Deprecated alias for Dirent['parentPath'] Somewhat counterintuitively, - * this property refers to the *parent* path, not the path object itself. + * Return true if the path is a match for the given path name. This handles + * case sensitivity and unicode normalization. + * + * Note: even on case-sensitive systems, it is **not** safe to test the + * equality of the `.name` property to determine whether a given pathname + * matches, due to unicode normalization mismatches. + * + * Always use this method instead of testing the `path.name` property + * directly. */ - get path() { - return this.parentPath; + isNamed(n) { + return !this.nocase ? + this.#matchName === normalize(n) + : this.#matchName === normalizeNocase(n); } /** - * Do not create new Path objects directly. They should always be accessed - * via the PathScurry class or other methods on the Path class. + * Return the Path object corresponding to the target of a symbolic link. * - * @internal + * If the Path is not a symbolic link, or if the readlink call fails for any + * reason, `undefined` is returned. + * + * Result is cached, and thus may be outdated if the filesystem is mutated. */ - constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) { - this.name = name; - this.#matchName = nocase ? normalizeNocase(name) : normalize(name); - this.#type = type & TYPEMASK; - this.nocase = nocase; - this.roots = roots; - this.root = root || this; - this.#children = children; - this.#fullpath = opts.fullpath; - this.#relative = opts.relative; - this.#relativePosix = opts.relativePosix; - this.parent = opts.parent; - if (this.parent) { - this.#fs = this.parent.#fs; + async readlink() { + const target = this.#linkTarget; + if (target) { + return target; } - else { - this.#fs = fsFromOption(opts.fs); + if (!this.canReadlink()) { + return undefined; + } + /* c8 ignore start */ + // already covered by the canReadlink test, here for ts grumples + if (!this.parent) { + return undefined; + } + /* c8 ignore stop */ + try { + const read = await this.#fs.promises.readlink(this.fullpath()); + const linkTarget = (await this.parent.realpath())?.resolve(read); + if (linkTarget) { + return (this.#linkTarget = linkTarget); + } + } + catch (er) { + this.#readlinkFail(er.code); + return undefined; } } /** - * Returns the depth of the Path object from its root. - * - * For example, a path at `/foo/bar` would have a depth of 2. + * Synchronous {@link PathBase.readlink} */ - depth() { - if (this.#depth !== undefined) - return this.#depth; - if (!this.parent) - return (this.#depth = 0); - return (this.#depth = this.parent.depth() + 1); + readlinkSync() { + const target = this.#linkTarget; + if (target) { + return target; + } + if (!this.canReadlink()) { + return undefined; + } + /* c8 ignore start */ + // already covered by the canReadlink test, here for ts grumples + if (!this.parent) { + return undefined; + } + /* c8 ignore stop */ + try { + const read = this.#fs.readlinkSync(this.fullpath()); + const linkTarget = this.parent.realpathSync()?.resolve(read); + if (linkTarget) { + return (this.#linkTarget = linkTarget); + } + } + catch (er) { + this.#readlinkFail(er.code); + return undefined; + } + } + #readdirSuccess(children) { + // succeeded, mark readdir called bit + this.#type |= READDIR_CALLED; + // mark all remaining provisional children as ENOENT + for (let p = children.provisional; p < children.length; p++) { + const c = children[p]; + if (c) + c.#markENOENT(); + } + } + #markENOENT() { + // mark as UNKNOWN and ENOENT + if (this.#type & ENOENT) + return; + this.#type = (this.#type | ENOENT) & IFMT_UNKNOWN; + this.#markChildrenENOENT(); + } + #markChildrenENOENT() { + // all children are provisional and do not exist + const children = this.children(); + children.provisional = 0; + for (const p of children) { + p.#markENOENT(); + } + } + #markENOREALPATH() { + this.#type |= ENOREALPATH; + this.#markENOTDIR(); + } + // save the information when we know the entry is not a dir + #markENOTDIR() { + // entry is not a directory, so any children can't exist. + // this *should* be impossible, since any children created + // after it's been marked ENOTDIR should be marked ENOENT, + // so it won't even get to this point. + /* c8 ignore start */ + if (this.#type & ENOTDIR) + return; + /* c8 ignore stop */ + let t = this.#type; + // this could happen if we stat a dir, then delete it, + // then try to read it or one of its children. + if ((t & IFMT) === IFDIR) + t &= IFMT_UNKNOWN; + this.#type = t | ENOTDIR; + this.#markChildrenENOENT(); + } + #readdirFail(code = '') { + // markENOTDIR and markENOENT also set provisional=0 + if (code === 'ENOTDIR' || code === 'EPERM') { + this.#markENOTDIR(); + } + else if (code === 'ENOENT') { + this.#markENOENT(); + } + else { + this.children().provisional = 0; + } + } + #lstatFail(code = '') { + // Windows just raises ENOENT in this case, disable for win CI + /* c8 ignore start */ + if (code === 'ENOTDIR') { + // already know it has a parent by this point + const p = this.parent; + p.#markENOTDIR(); + } + else if (code === 'ENOENT') { + /* c8 ignore stop */ + this.#markENOENT(); + } + } + #readlinkFail(code = '') { + let ter = this.#type; + ter |= ENOREADLINK; + if (code === 'ENOENT') + ter |= ENOENT; + // windows gets a weird error when you try to readlink a file + if (code === 'EINVAL' || code === 'UNKNOWN') { + // exists, but not a symlink, we don't know WHAT it is, so remove + // all IFMT bits. + ter &= IFMT_UNKNOWN; + } + this.#type = ter; + // windows just gets ENOENT in this case. We do cover the case, + // just disabled because it's impossible on Windows CI + /* c8 ignore start */ + if (code === 'ENOTDIR' && this.parent) { + this.parent.#markENOTDIR(); + } + /* c8 ignore stop */ + } + #readdirAddChild(e, c) { + return (this.#readdirMaybePromoteChild(e, c) || + this.#readdirAddNewChild(e, c)); + } + #readdirAddNewChild(e, c) { + // alloc new entry at head, so it's never provisional + const type = entToType(e); + const child = this.newChild(e.name, type, { parent: this }); + const ifmt = child.#type & IFMT; + if (ifmt !== IFDIR && ifmt !== IFLNK && ifmt !== UNKNOWN) { + child.#type |= ENOTDIR; + } + c.unshift(child); + c.provisional++; + return child; + } + #readdirMaybePromoteChild(e, c) { + for (let p = c.provisional; p < c.length; p++) { + const pchild = c[p]; + const name = this.nocase ? normalizeNocase(e.name) : normalize(e.name); + if (name !== pchild.#matchName) { + continue; + } + return this.#readdirPromoteChild(e, pchild, p, c); + } + } + #readdirPromoteChild(e, p, index, c) { + const v = p.name; + // retain any other flags, but set ifmt from dirent + p.#type = (p.#type & IFMT_UNKNOWN) | entToType(e); + // case sensitivity fixing when we learn the true name. + if (v !== e.name) + p.name = e.name; + // just advance provisional index (potentially off the list), + // otherwise we have to splice/pop it out and re-insert at head + if (index !== c.provisional) { + if (index === c.length - 1) + c.pop(); + else + c.splice(index, 1); + c.unshift(p); + } + c.provisional++; + return p; } /** - * @internal + * Call lstat() on this Path, and update all known information that can be + * determined. + * + * Note that unlike `fs.lstat()`, the returned value does not contain some + * information, such as `mode`, `dev`, `nlink`, and `ino`. If that + * information is required, you will need to call `fs.lstat` yourself. + * + * If the Path refers to a nonexistent file, or if the lstat call fails for + * any reason, `undefined` is returned. Otherwise the updated Path object is + * returned. + * + * Results are cached, and thus may be out of date if the filesystem is + * mutated. */ - childrenCache() { - return this.#children; + async lstat() { + if ((this.#type & ENOENT) === 0) { + try { + this.#applyStat(await this.#fs.promises.lstat(this.fullpath())); + return this; + } + catch (er) { + this.#lstatFail(er.code); + } + } } /** - * Get the Path object referenced by the string path, resolved from this Path + * synchronous {@link PathBase.lstat} */ - resolve(path) { - if (!path) { - return this; + lstatSync() { + if ((this.#type & ENOENT) === 0) { + try { + this.#applyStat(this.#fs.lstatSync(this.fullpath())); + return this; + } + catch (er) { + this.#lstatFail(er.code); + } } - const rootPath = this.getRootString(path); - const dir = path.substring(rootPath.length); - const dirParts = dir.split(this.splitSep); - const result = rootPath ? - this.getRoot(rootPath).#resolveParts(dirParts) - : this.#resolveParts(dirParts); - return result; } - #resolveParts(dirParts) { - let p = this; - for (const part of dirParts) { - p = p.child(part); + #applyStat(st) { + const { atime, atimeMs, birthtime, birthtimeMs, blksize, blocks, ctime, ctimeMs, dev, gid, ino, mode, mtime, mtimeMs, nlink, rdev, size, uid, } = st; + this.#atime = atime; + this.#atimeMs = atimeMs; + this.#birthtime = birthtime; + this.#birthtimeMs = birthtimeMs; + this.#blksize = blksize; + this.#blocks = blocks; + this.#ctime = ctime; + this.#ctimeMs = ctimeMs; + this.#dev = dev; + this.#gid = gid; + this.#ino = ino; + this.#mode = mode; + this.#mtime = mtime; + this.#mtimeMs = mtimeMs; + this.#nlink = nlink; + this.#rdev = rdev; + this.#size = size; + this.#uid = uid; + const ifmt = entToType(st); + // retain any other flags, but set the ifmt + this.#type = (this.#type & IFMT_UNKNOWN) | ifmt | LSTAT_CALLED; + if (ifmt !== UNKNOWN && ifmt !== IFDIR && ifmt !== IFLNK) { + this.#type |= ENOTDIR; } - return p; + } + #onReaddirCB = []; + #readdirCBInFlight = false; + #callOnReaddirCB(children) { + this.#readdirCBInFlight = false; + const cbs = this.#onReaddirCB.slice(); + this.#onReaddirCB.length = 0; + cbs.forEach(cb => cb(null, children)); } /** - * Returns the cached children Path objects, if still available. If they - * have fallen out of the cache, then returns an empty array, and resets the - * READDIR_CALLED bit, so that future calls to readdir() will require an fs - * lookup. + * Standard node-style callback interface to get list of directory entries. * - * @internal + * If the Path cannot or does not contain any children, then an empty array + * is returned. + * + * Results are cached, and thus may be out of date if the filesystem is + * mutated. + * + * @param cb The callback called with (er, entries). Note that the `er` + * param is somewhat extraneous, as all readdir() errors are handled and + * simply result in an empty set of entries being returned. + * @param allowZalgo Boolean indicating that immediately known results should + * *not* be deferred with `queueMicrotask`. Defaults to `false`. Release + * zalgo at your peril, the dark pony lord is devious and unforgiving. */ - children() { - const cached = this.#children.get(this); - if (cached) { - return cached; + readdirCB(cb, allowZalgo = false) { + if (!this.canReaddir()) { + if (allowZalgo) + cb(null, []); + else + queueMicrotask(() => cb(null, [])); + return; } - const children = Object.assign([], { provisional: 0 }); - this.#children.set(this, children); - this.#type &= ~READDIR_CALLED; - return children; + const children = this.children(); + if (this.calledReaddir()) { + const c = children.slice(0, children.provisional); + if (allowZalgo) + cb(null, c); + else + queueMicrotask(() => cb(null, c)); + return; + } + // don't have to worry about zalgo at this point. + this.#onReaddirCB.push(cb); + if (this.#readdirCBInFlight) { + return; + } + this.#readdirCBInFlight = true; + // else read the directory, fill up children + // de-provisionalize any provisional children. + const fullpath = this.fullpath(); + this.#fs.readdir(fullpath, { withFileTypes: true }, (er, entries) => { + if (er) { + this.#readdirFail(er.code); + children.provisional = 0; + } + else { + // if we didn't get an error, we always get entries. + //@ts-ignore + for (const e of entries) { + this.#readdirAddChild(e, children); + } + this.#readdirSuccess(children); + } + this.#callOnReaddirCB(children.slice(0, children.provisional)); + return; + }); } + #asyncReaddirInFlight; /** - * Resolves a path portion and returns or creates the child Path. - * - * Returns `this` if pathPart is `''` or `'.'`, or `parent` if pathPart is - * `'..'`. - * - * This should not be called directly. If `pathPart` contains any path - * separators, it will lead to unsafe undefined behavior. + * Return an array of known child entries. * - * Use `Path.resolve()` instead. + * If the Path cannot or does not contain any children, then an empty array + * is returned. * - * @internal + * Results are cached, and thus may be out of date if the filesystem is + * mutated. */ - child(pathPart, opts) { - if (pathPart === '' || pathPart === '.') { - return this; - } - if (pathPart === '..') { - return this.parent || this; + async readdir() { + if (!this.canReaddir()) { + return []; } - // find the child const children = this.children(); - const name = this.nocase ? normalizeNocase(pathPart) : normalize(pathPart); - for (const p of children) { - if (p.#matchName === name) { - return p; - } + if (this.calledReaddir()) { + return children.slice(0, children.provisional); } - // didn't find it, create provisional child, since it might not - // actually exist. If we know the parent isn't a dir, then - // in fact it CAN'T exist. - const s = this.parent ? this.sep : ''; - const fullpath = this.#fullpath ? this.#fullpath + s + pathPart : undefined; - const pchild = this.newChild(pathPart, UNKNOWN, { - ...opts, - parent: this, - fullpath, - }); - if (!this.canReaddir()) { - pchild.#type |= ENOENT; + // else read the directory, fill up children + // de-provisionalize any provisional children. + const fullpath = this.fullpath(); + if (this.#asyncReaddirInFlight) { + await this.#asyncReaddirInFlight; } - // don't have to update provisional, because if we have real children, - // then provisional is set to children.length, otherwise a lower number - children.push(pchild); - return pchild; + else { + /* c8 ignore start */ + let resolve = () => { }; + /* c8 ignore stop */ + this.#asyncReaddirInFlight = new Promise(res => (resolve = res)); + try { + for (const e of await this.#fs.promises.readdir(fullpath, { + withFileTypes: true, + })) { + this.#readdirAddChild(e, children); + } + this.#readdirSuccess(children); + } + catch (er) { + this.#readdirFail(er.code); + children.provisional = 0; + } + this.#asyncReaddirInFlight = undefined; + resolve(); + } + return children.slice(0, children.provisional); } /** - * The relative path from the cwd. If it does not share an ancestor with - * the cwd, then this ends up being equivalent to the fullpath() + * synchronous {@link PathBase.readdir} */ - relative() { - if (this.isCWD) - return ''; - if (this.#relative !== undefined) { - return this.#relative; + readdirSync() { + if (!this.canReaddir()) { + return []; } - const name = this.name; - const p = this.parent; - if (!p) { - return (this.#relative = this.name); + const children = this.children(); + if (this.calledReaddir()) { + return children.slice(0, children.provisional); } - const pv = p.relative(); - return pv + (!pv || !p.parent ? '' : this.sep) + name; + // else read the directory, fill up children + // de-provisionalize any provisional children. + const fullpath = this.fullpath(); + try { + for (const e of this.#fs.readdirSync(fullpath, { + withFileTypes: true, + })) { + this.#readdirAddChild(e, children); + } + this.#readdirSuccess(children); + } + catch (er) { + this.#readdirFail(er.code); + children.provisional = 0; + } + return children.slice(0, children.provisional); + } + canReaddir() { + if (this.#type & ENOCHILD) + return false; + const ifmt = IFMT & this.#type; + // we always set ENOTDIR when setting IFMT, so should be impossible + /* c8 ignore start */ + if (!(ifmt === UNKNOWN || ifmt === IFDIR || ifmt === IFLNK)) { + return false; + } + /* c8 ignore stop */ + return true; + } + shouldWalk(dirs, walkFilter) { + return ((this.#type & IFDIR) === IFDIR && + !(this.#type & ENOCHILD) && + !dirs.has(this) && + (!walkFilter || walkFilter(this))); } /** - * The relative path from the cwd, using / as the path separator. - * If it does not share an ancestor with - * the cwd, then this ends up being equivalent to the fullpathPosix() - * On posix systems, this is identical to relative(). + * Return the Path object corresponding to path as resolved + * by realpath(3). + * + * If the realpath call fails for any reason, `undefined` is returned. + * + * Result is cached, and thus may be outdated if the filesystem is mutated. + * On success, returns a Path object. */ - relativePosix() { - if (this.sep === '/') - return this.relative(); - if (this.isCWD) - return ''; - if (this.#relativePosix !== undefined) - return this.#relativePosix; - const name = this.name; - const p = this.parent; - if (!p) { - return (this.#relativePosix = this.fullpathPosix()); + async realpath() { + if (this.#realpath) + return this.#realpath; + if ((ENOREALPATH | ENOREADLINK | ENOENT) & this.#type) + return undefined; + try { + const rp = await this.#fs.promises.realpath(this.fullpath()); + return (this.#realpath = this.resolve(rp)); + } + catch (_) { + this.#markENOREALPATH(); } - const pv = p.relativePosix(); - return pv + (!pv || !p.parent ? '' : '/') + name; } /** - * The fully resolved path string for this Path entry + * Synchronous {@link realpath} */ - fullpath() { - if (this.#fullpath !== undefined) { - return this.#fullpath; + realpathSync() { + if (this.#realpath) + return this.#realpath; + if ((ENOREALPATH | ENOREADLINK | ENOENT) & this.#type) + return undefined; + try { + const rp = this.#fs.realpathSync(this.fullpath()); + return (this.#realpath = this.resolve(rp)); } - const name = this.name; - const p = this.parent; - if (!p) { - return (this.#fullpath = this.name); + catch (_) { + this.#markENOREALPATH(); } - const pv = p.fullpath(); - const fp = pv + (!p.parent ? '' : this.sep) + name; - return (this.#fullpath = fp); } /** - * On platforms other than windows, this is identical to fullpath. + * Internal method to mark this Path object as the scurry cwd, + * called by {@link PathScurry#chdir} * - * On windows, this is overridden to return the forward-slash form of the - * full UNC path. + * @internal */ - fullpathPosix() { - if (this.#fullpathPosix !== undefined) - return this.#fullpathPosix; - if (this.sep === '/') - return (this.#fullpathPosix = this.fullpath()); - if (!this.parent) { - const p = this.fullpath().replace(/\\/g, '/'); - if (/^[a-z]:\//i.test(p)) { - return (this.#fullpathPosix = `//?/${p}`); - } - else { - return (this.#fullpathPosix = p); - } + [setAsCwd](oldCwd) { + if (oldCwd === this) + return; + oldCwd.isCWD = false; + this.isCWD = true; + const changed = new Set([]); + let rp = []; + let p = this; + while (p && p.parent) { + changed.add(p); + p.#relative = rp.join(this.sep); + p.#relativePosix = rp.join('/'); + p = p.parent; + rp.push('..'); + } + // now un-memoize parents of old cwd + p = oldCwd; + while (p && p.parent && !changed.has(p)) { + p.#relative = undefined; + p.#relativePosix = undefined; + p = p.parent; } - const p = this.parent; - const pfpp = p.fullpathPosix(); - const fpp = pfpp + (!pfpp || !p.parent ? '' : '/') + this.name; - return (this.#fullpathPosix = fpp); } +} +exports.PathBase = PathBase; +/** + * Path class used on win32 systems + * + * Uses `'\\'` as the path separator for returned paths, either `'\\'` or `'/'` + * as the path separator for parsing paths. + */ +class PathWin32 extends PathBase { /** - * Is the Path of an unknown type? - * - * Note that we might know *something* about it if there has been a previous - * filesystem operation, for example that it does not exist, or is not a - * link, or whether it has child entries. + * Separator for generating path strings. */ - isUnknown() { - return (this.#type & IFMT) === UNKNOWN; - } - isType(type) { - return this[`is${type}`](); - } - getType() { - return (this.isUnknown() ? 'Unknown' - : this.isDirectory() ? 'Directory' - : this.isFile() ? 'File' - : this.isSymbolicLink() ? 'SymbolicLink' - : this.isFIFO() ? 'FIFO' - : this.isCharacterDevice() ? 'CharacterDevice' - : this.isBlockDevice() ? 'BlockDevice' - : /* c8 ignore start */ this.isSocket() ? 'Socket' - : 'Unknown'); - /* c8 ignore stop */ - } + sep = '\\'; /** - * Is the Path a regular file? + * Separator for parsing path strings. */ - isFile() { - return (this.#type & IFMT) === IFREG; - } + splitSep = eitherSep; /** - * Is the Path a directory? + * Do not create new Path objects directly. They should always be accessed + * via the PathScurry class or other methods on the Path class. + * + * @internal */ - isDirectory() { - return (this.#type & IFMT) === IFDIR; + constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) { + super(name, type, root, roots, nocase, children, opts); } /** - * Is the path a character device? + * @internal */ - isCharacterDevice() { - return (this.#type & IFMT) === IFCHR; + newChild(name, type = UNKNOWN, opts = {}) { + return new PathWin32(name, type, this.root, this.roots, this.nocase, this.childrenCache(), opts); } /** - * Is the path a block device? + * @internal */ - isBlockDevice() { - return (this.#type & IFMT) === IFBLK; + getRootString(path) { + return node_path_1.win32.parse(path).root; } /** - * Is the path a FIFO pipe? + * @internal */ - isFIFO() { - return (this.#type & IFMT) === IFIFO; + getRoot(rootPath) { + rootPath = uncToDrive(rootPath.toUpperCase()); + if (rootPath === this.root.name) { + return this.root; + } + // ok, not that one, check if it matches another we know about + for (const [compare, root] of Object.entries(this.roots)) { + if (this.sameRoot(rootPath, compare)) { + return (this.roots[rootPath] = root); + } + } + // otherwise, have to create a new one. + return (this.roots[rootPath] = new PathScurryWin32(rootPath, this).root); } /** - * Is the path a socket? + * @internal */ - isSocket() { - return (this.#type & IFMT) === IFSOCK; + sameRoot(rootPath, compare = this.root.name) { + // windows can (rarely) have case-sensitive filesystem, but + // UNC and drive letters are always case-insensitive, and canonically + // represented uppercase. + rootPath = rootPath + .toUpperCase() + .replace(/\//g, '\\') + .replace(uncDriveRegexp, '$1\\'); + return rootPath === compare; } +} +exports.PathWin32 = PathWin32; +/** + * Path class used on all posix systems. + * + * Uses `'/'` as the path separator. + */ +class PathPosix extends PathBase { /** - * Is the path a symbolic link? + * separator for parsing path strings */ - isSymbolicLink() { - return (this.#type & IFLNK) === IFLNK; - } + splitSep = '/'; /** - * Return the entry if it has been subject of a successful lstat, or - * undefined otherwise. - * - * Does not read the filesystem, so an undefined result *could* simply - * mean that we haven't called lstat on it. + * separator for generating path strings */ - lstatCached() { - return this.#type & LSTAT_CALLED ? this : undefined; - } + sep = '/'; /** - * Return the cached link target if the entry has been the subject of a - * successful readlink, or undefined otherwise. + * Do not create new Path objects directly. They should always be accessed + * via the PathScurry class or other methods on the Path class. * - * Does not read the filesystem, so an undefined result *could* just mean we - * don't have any cached data. Only use it if you are very sure that a - * readlink() has been called at some point. + * @internal */ - readlinkCached() { - return this.#linkTarget; + constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) { + super(name, type, root, roots, nocase, children, opts); } /** - * Returns the cached realpath target if the entry has been the subject - * of a successful realpath, or undefined otherwise. - * - * Does not read the filesystem, so an undefined result *could* just mean we - * don't have any cached data. Only use it if you are very sure that a - * realpath() has been called at some point. + * @internal */ - realpathCached() { - return this.#realpath; + getRootString(path) { + return path.startsWith('/') ? '/' : ''; } /** - * Returns the cached child Path entries array if the entry has been the - * subject of a successful readdir(), or [] otherwise. - * - * Does not read the filesystem, so an empty array *could* just mean we - * don't have any cached data. Only use it if you are very sure that a - * readdir() has been called recently enough to still be valid. + * @internal */ - readdirCached() { - const children = this.children(); - return children.slice(0, children.provisional); + getRoot(_rootPath) { + return this.root; } /** - * Return true if it's worth trying to readlink. Ie, we don't (yet) have - * any indication that readlink will definitely fail. - * - * Returns false if the path is known to not be a symlink, if a previous - * readlink failed, or if the entry does not exist. + * @internal */ - canReadlink() { - if (this.#linkTarget) - return true; - if (!this.parent) - return false; - // cases where it cannot possibly succeed - const ifmt = this.#type & IFMT; - return !((ifmt !== UNKNOWN && ifmt !== IFLNK) || - this.#type & ENOREADLINK || - this.#type & ENOENT); + newChild(name, type = UNKNOWN, opts = {}) { + return new PathPosix(name, type, this.root, this.roots, this.nocase, this.childrenCache(), opts); } +} +exports.PathPosix = PathPosix; +/** + * The base class for all PathScurry classes, providing the interface for path + * resolution and filesystem operations. + * + * Typically, you should *not* instantiate this class directly, but rather one + * of the platform-specific classes, or the exported {@link PathScurry} which + * defaults to the current platform. + */ +class PathScurryBase { /** - * Return true if readdir has previously been successfully called on this - * path, indicating that cachedReaddir() is likely valid. + * The root Path entry for the current working directory of this Scurry */ - calledReaddir() { - return !!(this.#type & READDIR_CALLED); - } + root; /** - * Returns true if the path is known to not exist. That is, a previous lstat - * or readdir failed to verify its existence when that would have been - * expected, or a parent entry was marked either enoent or enotdir. + * The string path for the root of this Scurry's current working directory */ - isENOENT() { - return !!(this.#type & ENOENT); - } + rootPath; /** - * Return true if the path is a match for the given path name. This handles - * case sensitivity and unicode normalization. - * - * Note: even on case-sensitive systems, it is **not** safe to test the - * equality of the `.name` property to determine whether a given pathname - * matches, due to unicode normalization mismatches. + * A collection of all roots encountered, referenced by rootPath + */ + roots; + /** + * The Path entry corresponding to this PathScurry's current working directory. + */ + cwd; + #resolveCache; + #resolvePosixCache; + #children; + /** + * Perform path comparisons case-insensitively. * - * Always use this method instead of testing the `path.name` property - * directly. + * Defaults true on Darwin and Windows systems, false elsewhere. */ - isNamed(n) { - return !this.nocase ? - this.#matchName === normalize(n) - : this.#matchName === normalizeNocase(n); - } + nocase; + #fs; /** - * Return the Path object corresponding to the target of a symbolic link. + * This class should not be instantiated directly. * - * If the Path is not a symbolic link, or if the readlink call fails for any - * reason, `undefined` is returned. + * Use PathScurryWin32, PathScurryDarwin, PathScurryPosix, or PathScurry * - * Result is cached, and thus may be outdated if the filesystem is mutated. + * @internal */ - async readlink() { - const target = this.#linkTarget; - if (target) { - return target; + constructor(cwd = process.cwd(), pathImpl, sep, { nocase, childrenCacheSize = 16 * 1024, fs = defaultFS, } = {}) { + this.#fs = fsFromOption(fs); + if (cwd instanceof URL || cwd.startsWith('file://')) { + cwd = (0, node_url_1.fileURLToPath)(cwd); } - if (!this.canReadlink()) { - return undefined; + // resolve and split root, and then add to the store. + // this is the only time we call path.resolve() + const cwdPath = pathImpl.resolve(cwd); + this.roots = Object.create(null); + this.rootPath = this.parseRootPath(cwdPath); + this.#resolveCache = new ResolveCache(); + this.#resolvePosixCache = new ResolveCache(); + this.#children = new ChildrenCache(childrenCacheSize); + const split = cwdPath.substring(this.rootPath.length).split(sep); + // resolve('/') leaves '', splits to [''], we don't want that. + if (split.length === 1 && !split[0]) { + split.pop(); } /* c8 ignore start */ - // already covered by the canReadlink test, here for ts grumples - if (!this.parent) { - return undefined; + if (nocase === undefined) { + throw new TypeError('must provide nocase setting to PathScurryBase ctor'); } /* c8 ignore stop */ - try { - const read = await this.#fs.promises.readlink(this.fullpath()); - const linkTarget = (await this.parent.realpath())?.resolve(read); - if (linkTarget) { - return (this.#linkTarget = linkTarget); - } - } - catch (er) { - this.#readlinkFail(er.code); - return undefined; + this.nocase = nocase; + this.root = this.newRoot(this.#fs); + this.roots[this.rootPath] = this.root; + let prev = this.root; + let len = split.length - 1; + const joinSep = pathImpl.sep; + let abs = this.rootPath; + let sawFirst = false; + for (const part of split) { + const l = len--; + prev = prev.child(part, { + relative: new Array(l).fill('..').join(joinSep), + relativePosix: new Array(l).fill('..').join('/'), + fullpath: (abs += (sawFirst ? '' : joinSep) + part), + }); + sawFirst = true; } + this.cwd = prev; } /** - * Synchronous {@link PathBase.readlink} + * Get the depth of a provided path, string, or the cwd */ - readlinkSync() { - const target = this.#linkTarget; - if (target) { - return target; - } - if (!this.canReadlink()) { - return undefined; - } - /* c8 ignore start */ - // already covered by the canReadlink test, here for ts grumples - if (!this.parent) { - return undefined; - } - /* c8 ignore stop */ - try { - const read = this.#fs.readlinkSync(this.fullpath()); - const linkTarget = this.parent.realpathSync()?.resolve(read); - if (linkTarget) { - return (this.#linkTarget = linkTarget); - } - } - catch (er) { - this.#readlinkFail(er.code); - return undefined; - } - } - #readdirSuccess(children) { - // succeeded, mark readdir called bit - this.#type |= READDIR_CALLED; - // mark all remaining provisional children as ENOENT - for (let p = children.provisional; p < children.length; p++) { - const c = children[p]; - if (c) - c.#markENOENT(); - } - } - #markENOENT() { - // mark as UNKNOWN and ENOENT - if (this.#type & ENOENT) - return; - this.#type = (this.#type | ENOENT) & IFMT_UNKNOWN; - this.#markChildrenENOENT(); - } - #markChildrenENOENT() { - // all children are provisional and do not exist - const children = this.children(); - children.provisional = 0; - for (const p of children) { - p.#markENOENT(); - } - } - #markENOREALPATH() { - this.#type |= ENOREALPATH; - this.#markENOTDIR(); - } - // save the information when we know the entry is not a dir - #markENOTDIR() { - // entry is not a directory, so any children can't exist. - // this *should* be impossible, since any children created - // after it's been marked ENOTDIR should be marked ENOENT, - // so it won't even get to this point. - /* c8 ignore start */ - if (this.#type & ENOTDIR) - return; - /* c8 ignore stop */ - let t = this.#type; - // this could happen if we stat a dir, then delete it, - // then try to read it or one of its children. - if ((t & IFMT) === IFDIR) - t &= IFMT_UNKNOWN; - this.#type = t | ENOTDIR; - this.#markChildrenENOENT(); - } - #readdirFail(code = '') { - // markENOTDIR and markENOENT also set provisional=0 - if (code === 'ENOTDIR' || code === 'EPERM') { - this.#markENOTDIR(); - } - else if (code === 'ENOENT') { - this.#markENOENT(); - } - else { - this.children().provisional = 0; - } - } - #lstatFail(code = '') { - // Windows just raises ENOENT in this case, disable for win CI - /* c8 ignore start */ - if (code === 'ENOTDIR') { - // already know it has a parent by this point - const p = this.parent; - p.#markENOTDIR(); - } - else if (code === 'ENOENT') { - /* c8 ignore stop */ - this.#markENOENT(); - } - } - #readlinkFail(code = '') { - let ter = this.#type; - ter |= ENOREADLINK; - if (code === 'ENOENT') - ter |= ENOENT; - // windows gets a weird error when you try to readlink a file - if (code === 'EINVAL' || code === 'UNKNOWN') { - // exists, but not a symlink, we don't know WHAT it is, so remove - // all IFMT bits. - ter &= IFMT_UNKNOWN; - } - this.#type = ter; - // windows just gets ENOENT in this case. We do cover the case, - // just disabled because it's impossible on Windows CI - /* c8 ignore start */ - if (code === 'ENOTDIR' && this.parent) { - this.parent.#markENOTDIR(); + depth(path = this.cwd) { + if (typeof path === 'string') { + path = this.cwd.resolve(path); } - /* c8 ignore stop */ - } - #readdirAddChild(e, c) { - return (this.#readdirMaybePromoteChild(e, c) || - this.#readdirAddNewChild(e, c)); + return path.depth(); } - #readdirAddNewChild(e, c) { - // alloc new entry at head, so it's never provisional - const type = entToType(e); - const child = this.newChild(e.name, type, { parent: this }); - const ifmt = child.#type & IFMT; - if (ifmt !== IFDIR && ifmt !== IFLNK && ifmt !== UNKNOWN) { - child.#type |= ENOTDIR; - } - c.unshift(child); - c.provisional++; - return child; + /** + * Return the cache of child entries. Exposed so subclasses can create + * child Path objects in a platform-specific way. + * + * @internal + */ + childrenCache() { + return this.#children; } - #readdirMaybePromoteChild(e, c) { - for (let p = c.provisional; p < c.length; p++) { - const pchild = c[p]; - const name = this.nocase ? normalizeNocase(e.name) : normalize(e.name); - if (name !== pchild.#matchName) { + /** + * Resolve one or more path strings to a resolved string + * + * Same interface as require('path').resolve. + * + * Much faster than path.resolve() when called multiple times for the same + * path, because the resolved Path objects are cached. Much slower + * otherwise. + */ + resolve(...paths) { + // first figure out the minimum number of paths we have to test + // we always start at cwd, but any absolutes will bump the start + let r = ''; + for (let i = paths.length - 1; i >= 0; i--) { + const p = paths[i]; + if (!p || p === '.') continue; + r = r ? `${p}/${r}` : p; + if (this.isAbsolute(p)) { + break; } - return this.#readdirPromoteChild(e, pchild, p, c); } - } - #readdirPromoteChild(e, p, index, c) { - const v = p.name; - // retain any other flags, but set ifmt from dirent - p.#type = (p.#type & IFMT_UNKNOWN) | entToType(e); - // case sensitivity fixing when we learn the true name. - if (v !== e.name) - p.name = e.name; - // just advance provisional index (potentially off the list), - // otherwise we have to splice/pop it out and re-insert at head - if (index !== c.provisional) { - if (index === c.length - 1) - c.pop(); - else - c.splice(index, 1); - c.unshift(p); + const cached = this.#resolveCache.get(r); + if (cached !== undefined) { + return cached; } - c.provisional++; - return p; + const result = this.cwd.resolve(r).fullpath(); + this.#resolveCache.set(r, result); + return result; } /** - * Call lstat() on this Path, and update all known information that can be - * determined. - * - * Note that unlike `fs.lstat()`, the returned value does not contain some - * information, such as `mode`, `dev`, `nlink`, and `ino`. If that - * information is required, you will need to call `fs.lstat` yourself. + * Resolve one or more path strings to a resolved string, returning + * the posix path. Identical to .resolve() on posix systems, but on + * windows will return a forward-slash separated UNC path. * - * If the Path refers to a nonexistent file, or if the lstat call fails for - * any reason, `undefined` is returned. Otherwise the updated Path object is - * returned. + * Same interface as require('path').resolve. * - * Results are cached, and thus may be out of date if the filesystem is - * mutated. + * Much faster than path.resolve() when called multiple times for the same + * path, because the resolved Path objects are cached. Much slower + * otherwise. */ - async lstat() { - if ((this.#type & ENOENT) === 0) { - try { - this.#applyStat(await this.#fs.promises.lstat(this.fullpath())); - return this; - } - catch (er) { - this.#lstatFail(er.code); + resolvePosix(...paths) { + // first figure out the minimum number of paths we have to test + // we always start at cwd, but any absolutes will bump the start + let r = ''; + for (let i = paths.length - 1; i >= 0; i--) { + const p = paths[i]; + if (!p || p === '.') + continue; + r = r ? `${p}/${r}` : p; + if (this.isAbsolute(p)) { + break; } } + const cached = this.#resolvePosixCache.get(r); + if (cached !== undefined) { + return cached; + } + const result = this.cwd.resolve(r).fullpathPosix(); + this.#resolvePosixCache.set(r, result); + return result; } /** - * synchronous {@link PathBase.lstat} + * find the relative path from the cwd to the supplied path string or entry */ - lstatSync() { - if ((this.#type & ENOENT) === 0) { - try { - this.#applyStat(this.#fs.lstatSync(this.fullpath())); - return this; - } - catch (er) { - this.#lstatFail(er.code); - } + relative(entry = this.cwd) { + if (typeof entry === 'string') { + entry = this.cwd.resolve(entry); } + return entry.relative(); } - #applyStat(st) { - const { atime, atimeMs, birthtime, birthtimeMs, blksize, blocks, ctime, ctimeMs, dev, gid, ino, mode, mtime, mtimeMs, nlink, rdev, size, uid, } = st; - this.#atime = atime; - this.#atimeMs = atimeMs; - this.#birthtime = birthtime; - this.#birthtimeMs = birthtimeMs; - this.#blksize = blksize; - this.#blocks = blocks; - this.#ctime = ctime; - this.#ctimeMs = ctimeMs; - this.#dev = dev; - this.#gid = gid; - this.#ino = ino; - this.#mode = mode; - this.#mtime = mtime; - this.#mtimeMs = mtimeMs; - this.#nlink = nlink; - this.#rdev = rdev; - this.#size = size; - this.#uid = uid; - const ifmt = entToType(st); - // retain any other flags, but set the ifmt - this.#type = (this.#type & IFMT_UNKNOWN) | ifmt | LSTAT_CALLED; - if (ifmt !== UNKNOWN && ifmt !== IFDIR && ifmt !== IFLNK) { - this.#type |= ENOTDIR; + /** + * find the relative path from the cwd to the supplied path string or + * entry, using / as the path delimiter, even on Windows. + */ + relativePosix(entry = this.cwd) { + if (typeof entry === 'string') { + entry = this.cwd.resolve(entry); } + return entry.relativePosix(); } - #onReaddirCB = []; - #readdirCBInFlight = false; - #callOnReaddirCB(children) { - this.#readdirCBInFlight = false; - const cbs = this.#onReaddirCB.slice(); - this.#onReaddirCB.length = 0; - cbs.forEach(cb => cb(null, children)); + /** + * Return the basename for the provided string or Path object + */ + basename(entry = this.cwd) { + if (typeof entry === 'string') { + entry = this.cwd.resolve(entry); + } + return entry.name; } /** - * Standard node-style callback interface to get list of directory entries. - * - * If the Path cannot or does not contain any children, then an empty array - * is returned. - * - * Results are cached, and thus may be out of date if the filesystem is - * mutated. - * - * @param cb The callback called with (er, entries). Note that the `er` - * param is somewhat extraneous, as all readdir() errors are handled and - * simply result in an empty set of entries being returned. - * @param allowZalgo Boolean indicating that immediately known results should - * *not* be deferred with `queueMicrotask`. Defaults to `false`. Release - * zalgo at your peril, the dark pony lord is devious and unforgiving. + * Return the dirname for the provided string or Path object */ - readdirCB(cb, allowZalgo = false) { - if (!this.canReaddir()) { - if (allowZalgo) - cb(null, []); - else - queueMicrotask(() => cb(null, [])); - return; + dirname(entry = this.cwd) { + if (typeof entry === 'string') { + entry = this.cwd.resolve(entry); } - const children = this.children(); - if (this.calledReaddir()) { - const c = children.slice(0, children.provisional); - if (allowZalgo) - cb(null, c); - else - queueMicrotask(() => cb(null, c)); - return; + return (entry.parent || entry).fullpath(); + } + async readdir(entry = this.cwd, opts = { + withFileTypes: true, + }) { + if (typeof entry === 'string') { + entry = this.cwd.resolve(entry); } - // don't have to worry about zalgo at this point. - this.#onReaddirCB.push(cb); - if (this.#readdirCBInFlight) { - return; + else if (!(entry instanceof PathBase)) { + opts = entry; + entry = this.cwd; + } + const { withFileTypes } = opts; + if (!entry.canReaddir()) { + return []; + } + else { + const p = await entry.readdir(); + return withFileTypes ? p : p.map(e => e.name); + } + } + readdirSync(entry = this.cwd, opts = { + withFileTypes: true, + }) { + if (typeof entry === 'string') { + entry = this.cwd.resolve(entry); + } + else if (!(entry instanceof PathBase)) { + opts = entry; + entry = this.cwd; + } + const { withFileTypes = true } = opts; + if (!entry.canReaddir()) { + return []; + } + else if (withFileTypes) { + return entry.readdirSync(); + } + else { + return entry.readdirSync().map(e => e.name); } - this.#readdirCBInFlight = true; - // else read the directory, fill up children - // de-provisionalize any provisional children. - const fullpath = this.fullpath(); - this.#fs.readdir(fullpath, { withFileTypes: true }, (er, entries) => { - if (er) { - this.#readdirFail(er.code); - children.provisional = 0; - } - else { - // if we didn't get an error, we always get entries. - //@ts-ignore - for (const e of entries) { - this.#readdirAddChild(e, children); - } - this.#readdirSuccess(children); - } - this.#callOnReaddirCB(children.slice(0, children.provisional)); - return; - }); } - #asyncReaddirInFlight; /** - * Return an array of known child entries. + * Call lstat() on the string or Path object, and update all known + * information that can be determined. * - * If the Path cannot or does not contain any children, then an empty array - * is returned. + * Note that unlike `fs.lstat()`, the returned value does not contain some + * information, such as `mode`, `dev`, `nlink`, and `ino`. If that + * information is required, you will need to call `fs.lstat` yourself. + * + * If the Path refers to a nonexistent file, or if the lstat call fails for + * any reason, `undefined` is returned. Otherwise the updated Path object is + * returned. * * Results are cached, and thus may be out of date if the filesystem is * mutated. */ - async readdir() { - if (!this.canReaddir()) { - return []; - } - const children = this.children(); - if (this.calledReaddir()) { - return children.slice(0, children.provisional); - } - // else read the directory, fill up children - // de-provisionalize any provisional children. - const fullpath = this.fullpath(); - if (this.#asyncReaddirInFlight) { - await this.#asyncReaddirInFlight; - } - else { - /* c8 ignore start */ - let resolve = () => { }; - /* c8 ignore stop */ - this.#asyncReaddirInFlight = new Promise(res => (resolve = res)); - try { - for (const e of await this.#fs.promises.readdir(fullpath, { - withFileTypes: true, - })) { - this.#readdirAddChild(e, children); - } - this.#readdirSuccess(children); - } - catch (er) { - this.#readdirFail(er.code); - children.provisional = 0; - } - this.#asyncReaddirInFlight = undefined; - resolve(); + async lstat(entry = this.cwd) { + if (typeof entry === 'string') { + entry = this.cwd.resolve(entry); } - return children.slice(0, children.provisional); + return entry.lstat(); } /** - * synchronous {@link PathBase.readdir} + * synchronous {@link PathScurryBase.lstat} */ - readdirSync() { - if (!this.canReaddir()) { - return []; + lstatSync(entry = this.cwd) { + if (typeof entry === 'string') { + entry = this.cwd.resolve(entry); } - const children = this.children(); - if (this.calledReaddir()) { - return children.slice(0, children.provisional); + return entry.lstatSync(); + } + async readlink(entry = this.cwd, { withFileTypes } = { + withFileTypes: false, + }) { + if (typeof entry === 'string') { + entry = this.cwd.resolve(entry); } - // else read the directory, fill up children - // de-provisionalize any provisional children. - const fullpath = this.fullpath(); - try { - for (const e of this.#fs.readdirSync(fullpath, { - withFileTypes: true, - })) { - this.#readdirAddChild(e, children); - } - this.#readdirSuccess(children); + else if (!(entry instanceof PathBase)) { + withFileTypes = entry.withFileTypes; + entry = this.cwd; } - catch (er) { - this.#readdirFail(er.code); - children.provisional = 0; + const e = await entry.readlink(); + return withFileTypes ? e : e?.fullpath(); + } + readlinkSync(entry = this.cwd, { withFileTypes } = { + withFileTypes: false, + }) { + if (typeof entry === 'string') { + entry = this.cwd.resolve(entry); } - return children.slice(0, children.provisional); + else if (!(entry instanceof PathBase)) { + withFileTypes = entry.withFileTypes; + entry = this.cwd; + } + const e = entry.readlinkSync(); + return withFileTypes ? e : e?.fullpath(); } - canReaddir() { - if (this.#type & ENOCHILD) - return false; - const ifmt = IFMT & this.#type; - // we always set ENOTDIR when setting IFMT, so should be impossible - /* c8 ignore start */ - if (!(ifmt === UNKNOWN || ifmt === IFDIR || ifmt === IFLNK)) { - return false; + async realpath(entry = this.cwd, { withFileTypes } = { + withFileTypes: false, + }) { + if (typeof entry === 'string') { + entry = this.cwd.resolve(entry); } - /* c8 ignore stop */ - return true; + else if (!(entry instanceof PathBase)) { + withFileTypes = entry.withFileTypes; + entry = this.cwd; + } + const e = await entry.realpath(); + return withFileTypes ? e : e?.fullpath(); } - shouldWalk(dirs, walkFilter) { - return ((this.#type & IFDIR) === IFDIR && - !(this.#type & ENOCHILD) && - !dirs.has(this) && - (!walkFilter || walkFilter(this))); + realpathSync(entry = this.cwd, { withFileTypes } = { + withFileTypes: false, + }) { + if (typeof entry === 'string') { + entry = this.cwd.resolve(entry); + } + else if (!(entry instanceof PathBase)) { + withFileTypes = entry.withFileTypes; + entry = this.cwd; + } + const e = entry.realpathSync(); + return withFileTypes ? e : e?.fullpath(); } - /** - * Return the Path object corresponding to path as resolved - * by realpath(3). - * - * If the realpath call fails for any reason, `undefined` is returned. - * - * Result is cached, and thus may be outdated if the filesystem is mutated. - * On success, returns a Path object. - */ - async realpath() { - if (this.#realpath) - return this.#realpath; - if ((ENOREALPATH | ENOREADLINK | ENOENT) & this.#type) - return undefined; - try { - const rp = await this.#fs.promises.realpath(this.fullpath()); - return (this.#realpath = this.resolve(rp)); + async walk(entry = this.cwd, opts = {}) { + if (typeof entry === 'string') { + entry = this.cwd.resolve(entry); } - catch (_) { - this.#markENOREALPATH(); + else if (!(entry instanceof PathBase)) { + opts = entry; + entry = this.cwd; + } + const { withFileTypes = true, follow = false, filter, walkFilter, } = opts; + const results = []; + if (!filter || filter(entry)) { + results.push(withFileTypes ? entry : entry.fullpath()); } + const dirs = new Set(); + const walk = (dir, cb) => { + dirs.add(dir); + dir.readdirCB((er, entries) => { + /* c8 ignore start */ + if (er) { + return cb(er); + } + /* c8 ignore stop */ + let len = entries.length; + if (!len) + return cb(); + const next = () => { + if (--len === 0) { + cb(); + } + }; + for (const e of entries) { + if (!filter || filter(e)) { + results.push(withFileTypes ? e : e.fullpath()); + } + if (follow && e.isSymbolicLink()) { + e.realpath() + .then(r => (r?.isUnknown() ? r.lstat() : r)) + .then(r => r?.shouldWalk(dirs, walkFilter) ? walk(r, next) : next()); + } + else { + if (e.shouldWalk(dirs, walkFilter)) { + walk(e, next); + } + else { + next(); + } + } + } + }, true); // zalgooooooo + }; + const start = entry; + return new Promise((res, rej) => { + walk(start, er => { + /* c8 ignore start */ + if (er) + return rej(er); + /* c8 ignore stop */ + res(results); + }); + }); } - /** - * Synchronous {@link realpath} - */ - realpathSync() { - if (this.#realpath) - return this.#realpath; - if ((ENOREALPATH | ENOREADLINK | ENOENT) & this.#type) - return undefined; - try { - const rp = this.#fs.realpathSync(this.fullpath()); - return (this.#realpath = this.resolve(rp)); + walkSync(entry = this.cwd, opts = {}) { + if (typeof entry === 'string') { + entry = this.cwd.resolve(entry); } - catch (_) { - this.#markENOREALPATH(); + else if (!(entry instanceof PathBase)) { + opts = entry; + entry = this.cwd; } + const { withFileTypes = true, follow = false, filter, walkFilter, } = opts; + const results = []; + if (!filter || filter(entry)) { + results.push(withFileTypes ? entry : entry.fullpath()); + } + const dirs = new Set([entry]); + for (const dir of dirs) { + const entries = dir.readdirSync(); + for (const e of entries) { + if (!filter || filter(e)) { + results.push(withFileTypes ? e : e.fullpath()); + } + let r = e; + if (e.isSymbolicLink()) { + if (!(follow && (r = e.realpathSync()))) + continue; + if (r.isUnknown()) + r.lstatSync(); + } + if (r.shouldWalk(dirs, walkFilter)) { + dirs.add(r); + } + } + } + return results; } /** - * Internal method to mark this Path object as the scurry cwd, - * called by {@link PathScurry#chdir} + * Support for `for await` * - * @internal + * Alias for {@link PathScurryBase.iterate} + * + * Note: As of Node 19, this is very slow, compared to other methods of + * walking. Consider using {@link PathScurryBase.stream} if memory overhead + * and backpressure are concerns, or {@link PathScurryBase.walk} if not. */ - [setAsCwd](oldCwd) { - if (oldCwd === this) - return; - oldCwd.isCWD = false; - this.isCWD = true; - const changed = new Set([]); - let rp = []; - let p = this; - while (p && p.parent) { - changed.add(p); - p.#relative = rp.join(this.sep); - p.#relativePosix = rp.join('/'); - p = p.parent; - rp.push('..'); + [Symbol.asyncIterator]() { + return this.iterate(); + } + iterate(entry = this.cwd, options = {}) { + // iterating async over the stream is significantly more performant, + // especially in the warm-cache scenario, because it buffers up directory + // entries in the background instead of waiting for a yield for each one. + if (typeof entry === 'string') { + entry = this.cwd.resolve(entry); } - // now un-memoize parents of old cwd - p = oldCwd; - while (p && p.parent && !changed.has(p)) { - p.#relative = undefined; - p.#relativePosix = undefined; - p = p.parent; + else if (!(entry instanceof PathBase)) { + options = entry; + entry = this.cwd; } + return this.stream(entry, options)[Symbol.asyncIterator](); } -} -exports.PathBase = PathBase; -/** - * Path class used on win32 systems - * - * Uses `'\\'` as the path separator for returned paths, either `'\\'` or `'/'` - * as the path separator for parsing paths. - */ -class PathWin32 extends PathBase { - /** - * Separator for generating path strings. - */ - sep = '\\'; /** - * Separator for parsing path strings. - */ - splitSep = eitherSep; - /** - * Do not create new Path objects directly. They should always be accessed - * via the PathScurry class or other methods on the Path class. + * Iterating over a PathScurry performs a synchronous walk. * - * @internal - */ - constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) { - super(name, type, root, roots, nocase, children, opts); - } - /** - * @internal + * Alias for {@link PathScurryBase.iterateSync} */ - newChild(name, type = UNKNOWN, opts = {}) { - return new PathWin32(name, type, this.root, this.roots, this.nocase, this.childrenCache(), opts); + [Symbol.iterator]() { + return this.iterateSync(); } - /** - * @internal - */ - getRootString(path) { - return node_path_1.win32.parse(path).root; + *iterateSync(entry = this.cwd, opts = {}) { + if (typeof entry === 'string') { + entry = this.cwd.resolve(entry); + } + else if (!(entry instanceof PathBase)) { + opts = entry; + entry = this.cwd; + } + const { withFileTypes = true, follow = false, filter, walkFilter, } = opts; + if (!filter || filter(entry)) { + yield withFileTypes ? entry : entry.fullpath(); + } + const dirs = new Set([entry]); + for (const dir of dirs) { + const entries = dir.readdirSync(); + for (const e of entries) { + if (!filter || filter(e)) { + yield withFileTypes ? e : e.fullpath(); + } + let r = e; + if (e.isSymbolicLink()) { + if (!(follow && (r = e.realpathSync()))) + continue; + if (r.isUnknown()) + r.lstatSync(); + } + if (r.shouldWalk(dirs, walkFilter)) { + dirs.add(r); + } + } + } } - /** - * @internal - */ - getRoot(rootPath) { - rootPath = uncToDrive(rootPath.toUpperCase()); - if (rootPath === this.root.name) { - return this.root; + stream(entry = this.cwd, opts = {}) { + if (typeof entry === 'string') { + entry = this.cwd.resolve(entry); } - // ok, not that one, check if it matches another we know about - for (const [compare, root] of Object.entries(this.roots)) { - if (this.sameRoot(rootPath, compare)) { - return (this.roots[rootPath] = root); + else if (!(entry instanceof PathBase)) { + opts = entry; + entry = this.cwd; + } + const { withFileTypes = true, follow = false, filter, walkFilter, } = opts; + const results = new minipass_1.Minipass({ objectMode: true }); + if (!filter || filter(entry)) { + results.write(withFileTypes ? entry : entry.fullpath()); + } + const dirs = new Set(); + const queue = [entry]; + let processing = 0; + const process = () => { + let paused = false; + while (!paused) { + const dir = queue.shift(); + if (!dir) { + if (processing === 0) + results.end(); + return; + } + processing++; + dirs.add(dir); + const onReaddir = (er, entries, didRealpaths = false) => { + /* c8 ignore start */ + if (er) + return results.emit('error', er); + /* c8 ignore stop */ + if (follow && !didRealpaths) { + const promises = []; + for (const e of entries) { + if (e.isSymbolicLink()) { + promises.push(e + .realpath() + .then((r) => r?.isUnknown() ? r.lstat() : r)); + } + } + if (promises.length) { + Promise.all(promises).then(() => onReaddir(null, entries, true)); + return; + } + } + for (const e of entries) { + if (e && (!filter || filter(e))) { + if (!results.write(withFileTypes ? e : e.fullpath())) { + paused = true; + } + } + } + processing--; + for (const e of entries) { + const r = e.realpathCached() || e; + if (r.shouldWalk(dirs, walkFilter)) { + queue.push(r); + } + } + if (paused && !results.flowing) { + results.once('drain', process); + } + else if (!sync) { + process(); + } + }; + // zalgo containment + let sync = true; + dir.readdirCB(onReaddir, true); + sync = false; } + }; + process(); + return results; + } + streamSync(entry = this.cwd, opts = {}) { + if (typeof entry === 'string') { + entry = this.cwd.resolve(entry); } - // otherwise, have to create a new one. - return (this.roots[rootPath] = new PathScurryWin32(rootPath, this).root); + else if (!(entry instanceof PathBase)) { + opts = entry; + entry = this.cwd; + } + const { withFileTypes = true, follow = false, filter, walkFilter, } = opts; + const results = new minipass_1.Minipass({ objectMode: true }); + const dirs = new Set(); + if (!filter || filter(entry)) { + results.write(withFileTypes ? entry : entry.fullpath()); + } + const queue = [entry]; + let processing = 0; + const process = () => { + let paused = false; + while (!paused) { + const dir = queue.shift(); + if (!dir) { + if (processing === 0) + results.end(); + return; + } + processing++; + dirs.add(dir); + const entries = dir.readdirSync(); + for (const e of entries) { + if (!filter || filter(e)) { + if (!results.write(withFileTypes ? e : e.fullpath())) { + paused = true; + } + } + } + processing--; + for (const e of entries) { + let r = e; + if (e.isSymbolicLink()) { + if (!(follow && (r = e.realpathSync()))) + continue; + if (r.isUnknown()) + r.lstatSync(); + } + if (r.shouldWalk(dirs, walkFilter)) { + queue.push(r); + } + } + } + if (paused && !results.flowing) + results.once('drain', process); + }; + process(); + return results; } - /** - * @internal - */ - sameRoot(rootPath, compare = this.root.name) { - // windows can (rarely) have case-sensitive filesystem, but - // UNC and drive letters are always case-insensitive, and canonically - // represented uppercase. - rootPath = rootPath - .toUpperCase() - .replace(/\//g, '\\') - .replace(uncDriveRegexp, '$1\\'); - return rootPath === compare; + chdir(path = this.cwd) { + const oldCwd = this.cwd; + this.cwd = typeof path === 'string' ? this.cwd.resolve(path) : path; + this.cwd[setAsCwd](oldCwd); } } -exports.PathWin32 = PathWin32; +exports.PathScurryBase = PathScurryBase; /** - * Path class used on all posix systems. + * Windows implementation of {@link PathScurryBase} * - * Uses `'/'` as the path separator. + * Defaults to case insensitve, uses `'\\'` to generate path strings. Uses + * {@link PathWin32} for Path objects. */ -class PathPosix extends PathBase { - /** - * separator for parsing path strings - */ - splitSep = '/'; +class PathScurryWin32 extends PathScurryBase { /** * separator for generating path strings */ - sep = '/'; - /** - * Do not create new Path objects directly. They should always be accessed - * via the PathScurry class or other methods on the Path class. - * - * @internal - */ - constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) { - super(name, type, root, roots, nocase, children, opts); + sep = '\\'; + constructor(cwd = process.cwd(), opts = {}) { + const { nocase = true } = opts; + super(cwd, node_path_1.win32, '\\', { ...opts, nocase }); + this.nocase = nocase; + for (let p = this.cwd; p; p = p.parent) { + p.nocase = this.nocase; + } } /** * @internal */ - getRootString(path) { - return path.startsWith('/') ? '/' : ''; + parseRootPath(dir) { + // if the path starts with a single separator, it's not a UNC, and we'll + // just get separator as the root, and driveFromUNC will return \ + // In that case, mount \ on the root from the cwd. + return node_path_1.win32.parse(dir).root.toUpperCase(); } /** * @internal */ - getRoot(_rootPath) { - return this.root; + newRoot(fs) { + return new PathWin32(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs }); } /** - * @internal + * Return true if the provided path string is an absolute path */ - newChild(name, type = UNKNOWN, opts = {}) { - return new PathPosix(name, type, this.root, this.roots, this.nocase, this.childrenCache(), opts); + isAbsolute(p) { + return (p.startsWith('/') || p.startsWith('\\') || /^[a-z]:(\/|\\)/i.test(p)); } } -exports.PathPosix = PathPosix; +exports.PathScurryWin32 = PathScurryWin32; /** - * The base class for all PathScurry classes, providing the interface for path - * resolution and filesystem operations. + * {@link PathScurryBase} implementation for all posix systems other than Darwin. * - * Typically, you should *not* instantiate this class directly, but rather one - * of the platform-specific classes, or the exported {@link PathScurry} which - * defaults to the current platform. + * Defaults to case-sensitive matching, uses `'/'` to generate path strings. + * + * Uses {@link PathPosix} for Path objects. */ -class PathScurryBase { - /** - * The root Path entry for the current working directory of this Scurry - */ - root; - /** - * The string path for the root of this Scurry's current working directory - */ - rootPath; +class PathScurryPosix extends PathScurryBase { /** - * A collection of all roots encountered, referenced by rootPath + * separator for generating path strings */ - roots; + sep = '/'; + constructor(cwd = process.cwd(), opts = {}) { + const { nocase = false } = opts; + super(cwd, node_path_1.posix, '/', { ...opts, nocase }); + this.nocase = nocase; + } /** - * The Path entry corresponding to this PathScurry's current working directory. + * @internal */ - cwd; - #resolveCache; - #resolvePosixCache; - #children; + parseRootPath(_dir) { + return '/'; + } /** - * Perform path comparisons case-insensitively. - * - * Defaults true on Darwin and Windows systems, false elsewhere. + * @internal */ - nocase; - #fs; + newRoot(fs) { + return new PathPosix(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs }); + } /** - * This class should not be instantiated directly. - * - * Use PathScurryWin32, PathScurryDarwin, PathScurryPosix, or PathScurry - * - * @internal + * Return true if the provided path string is an absolute path */ - constructor(cwd = process.cwd(), pathImpl, sep, { nocase, childrenCacheSize = 16 * 1024, fs = defaultFS, } = {}) { - this.#fs = fsFromOption(fs); - if (cwd instanceof URL || cwd.startsWith('file://')) { - cwd = (0, node_url_1.fileURLToPath)(cwd); + isAbsolute(p) { + return p.startsWith('/'); + } +} +exports.PathScurryPosix = PathScurryPosix; +/** + * {@link PathScurryBase} implementation for Darwin (macOS) systems. + * + * Defaults to case-insensitive matching, uses `'/'` for generating path + * strings. + * + * Uses {@link PathPosix} for Path objects. + */ +class PathScurryDarwin extends PathScurryPosix { + constructor(cwd = process.cwd(), opts = {}) { + const { nocase = true } = opts; + super(cwd, { ...opts, nocase }); + } +} +exports.PathScurryDarwin = PathScurryDarwin; +/** + * Default {@link PathBase} implementation for the current platform. + * + * {@link PathWin32} on Windows systems, {@link PathPosix} on all others. + */ +exports.Path = process.platform === 'win32' ? PathWin32 : PathPosix; +/** + * Default {@link PathScurryBase} implementation for the current platform. + * + * {@link PathScurryWin32} on Windows systems, {@link PathScurryDarwin} on + * Darwin (macOS) systems, {@link PathScurryPosix} on all others. + */ +exports.PathScurry = process.platform === 'win32' ? PathScurryWin32 + : process.platform === 'darwin' ? PathScurryDarwin + : PathScurryPosix; +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 2591: +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __nccwpck_require__) => { + +"use strict"; +// ESM COMPAT FLAG +__nccwpck_require__.r(__webpack_exports__); + +// EXPORTS +__nccwpck_require__.d(__webpack_exports__, { + "asCSV": () => (/* binding */ asCSV), + "asFiles": () => (/* binding */ asFiles), + "asMarkDown": () => (/* binding */ asMarkDown), + "asPlainVertical": () => (/* binding */ asPlainVertical), + "asSummary": () => (/* binding */ asSummary), + "asTree": () => (/* binding */ asTree), + "filterAttributes": () => (/* binding */ filterAttributes), + "init": () => (/* binding */ init), + "parseJson": () => (/* binding */ parseJson), + "print": () => (/* binding */ print), + "recursivelyCollectAllDependencies": () => (/* binding */ recursivelyCollectAllDependencies), + "writeOutput": () => (/* binding */ writeOutput) +}); + +// EXTERNAL MODULE: ./node_modules/chalk/source/index.js +var source = __nccwpck_require__(8818); +// EXTERNAL MODULE: ./node_modules/debug/src/index.js +var src = __nccwpck_require__(8237); +// EXTERNAL MODULE: external "node:fs" +var external_node_fs_ = __nccwpck_require__(7561); +// EXTERNAL MODULE: ./node_modules/mkdirp/index.js +var mkdirp = __nccwpck_require__(6186); +// EXTERNAL MODULE: external "node:path" +var external_node_path_ = __nccwpck_require__(9411); +// EXTERNAL MODULE: ./node_modules/read-installed-packages/read-installed.js +var read_installed = __nccwpck_require__(2057); +// EXTERNAL MODULE: ./node_modules/spdx-correct/index.js +var spdx_correct = __nccwpck_require__(2372); +// EXTERNAL MODULE: ./node_modules/spdx-satisfies/index.js +var spdx_satisfies = __nccwpck_require__(4424); +// EXTERNAL MODULE: ./node_modules/treeify/treeify.js +var treeify = __nccwpck_require__(355); +// EXTERNAL MODULE: external "crypto" +var external_crypto_ = __nccwpck_require__(6113); +// EXTERNAL MODULE: ./node_modules/semver/index.js +var semver = __nccwpck_require__(1383); +// EXTERNAL MODULE: ./node_modules/lodash.clonedeep/index.js +var lodash_clonedeep = __nccwpck_require__(2061); +;// CONCATENATED MODULE: ./node_modules/license-checker-rseidelsohn/lib/licenseCheckerHelpers.js + + + + + + + +const shouldColorizeOutput = function shouldColorizeOutput(args) { + return args.color && !args.out && !args.files && !(args.csv || args.json || args.markdown || args.plainVertical); +}; + +const colorizeOutput = function colorizeOutput(json) { + Object.keys(json).forEach((key) => { + const index = key.lastIndexOf('@'); + const colorizedKey = + chalk.white.bgKeyword('darkslategrey')(key.slice(0, index + 1)) + + chalk.dim('@') + + chalk.white.bgKeyword('green')(key.slice(index + 1)); + json[colorizedKey] = json[key]; + + delete json[key]; + }); +}; + +const filterJson = function filterJson(limitAttributes, json) { + let filteredJson = json; + + if (limitAttributes) { + filteredJson = {}; + const attributes = limitAttributes.split(',').map((attribute) => attribute.trim()); + + Object.keys(json).forEach((dependency) => { + filteredJson[dependency] = filterAttributes(attributes, json[dependency]); + }); + } + + return filteredJson; +}; + +const getFormattedOutput = function getFormattedOutput(modulesWithVersions, args) { + let filteredJson = filterJson(args.limitAttributes, modulesWithVersions); + const jsonCopy = lodash_clonedeep(filteredJson); + filteredJson = null; + + if (args.files) { + Object.keys(jsonCopy).forEach((moduleName) => { + const outPath = external_node_path_.join(args.files, `${moduleName}-LICENSE.txt`); + const originalLicenseFile = jsonCopy[moduleName].licenseFile; + + if (originalLicenseFile && external_node_fs_.existsSync(originalLicenseFile)) { + if (args.relativeLicensePath) { + if (args.out) { + jsonCopy[moduleName].licenseFile = external_node_path_.relative(external_node_path_.dirname(args.out), outPath); + } else { + jsonCopy[moduleName].licenseFile = external_node_path_.relative(process.cwd(), outPath); + } + } else { + jsonCopy[moduleName].licenseFile = outPath; + } + } + }); + } + + if (args.json) { + return JSON.stringify(jsonCopy, null, 4) + '\n'; + } + + if (args.csv) { + return asCSV(jsonCopy, args.customFormat, args.csvComponentPrefix); + } + + if (args.markdown) { + return asMarkDown(jsonCopy, args.customFormat) + '\n'; + } + + if (args.summary) { + return asSummary(jsonCopy); + } + + if (args.plainVertical || args.angluarCli) { + return asPlainVertical(jsonCopy); + } + + return asTree(jsonCopy); +}; + + + +// EXTERNAL MODULE: ./node_modules/spdx-expression-parse/index.js +var spdx_expression_parse = __nccwpck_require__(5254); +;// CONCATENATED MODULE: ./node_modules/license-checker-rseidelsohn/lib/getLicenseTitle.js + + +const MIT_LICENSE = /ermission is hereby granted, free of charge, to any/; +const BSD_LICENSE = /edistribution and use in source and binary forms, with or withou/; +const BSD_SOURCE_CODE_LICENSE = /edistribution and use of this software in source and binary forms, with or withou/; +const WTFPL_LICENSE = /DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE/; +const ISC_LICENSE = /The ISC License/; +const HIPPOCRATIC_LICENSE = /Hippocratic License/; +const MIT = /\bMIT\b/; +const BSD = /\bBSD\b/; +const ISC = /\bISC\b/; +const GPL = /\bGNU GENERAL PUBLIC LICENSE\s*Version ([^,]*)/i; +const LGPL = /(?:LESSER|LIBRARY) GENERAL PUBLIC LICENSE\s*Version ([^,]*)/i; +const APACHE_VERSION = /\bApache License\s*Version ([^,\s]*)/i; +const APACHE = /\bApache License\b/; +const APACHE_VERSION_SHORT = /\bApache ([^,\s]*)/i; +const WTFPL = /\bWTFPL\b/; +const ZERO_PARITY_LICENSE = /\bParity\b/; +// https://creativecommons.org/publicdomain/zero/1.0/ +const CC0_1_0 = + /The\s+person\s+who\s+associated\s+a\s+work\s+with\s+this\s+deed\s+has\s+dedicated\s+the\s+work\s+to\s+the\s+public\s+domain\s+by\s+waiving\s+all\s+of\s+his\s+or\s+her\s+rights\s+to\s+the\s+work\s+worldwide\s+under\s+copyright\s+law,\s+including\s+all\s+related\s+and\s+neighboring\s+rights,\s+to\s+the\s+extent\s+allowed\s+by\s+law.\s+You\s+can\s+copy,\s+modify,\s+distribute\s+and\s+perform\s+the\s+work,\s+even\s+for\s+commercial\s+purposes,\s+all\s+without\s+asking\s+permission./i; // jshint ignore:line +const PUBLIC_DOMAIN = /[Pp]ublic[\-_ ]*[Dd]omain/; +const IS_URL = /(https?:\/\/[-a-zA-Z0-9\/.]*)/; +const CONTAINS_URLS_ENDING_WITH = /(.svg|.gif|.png|.jpg|.jpeg)$/i; +const CONTAINS_LICENSE_TERM = /(license|licence|lizenz)/gi; +const IS_FILE_REFERENCE = /SEE LICENSE IN (.*)/i; +const UNLICENSED = /UNLICENSED/i; + +const getLicenseTitle = (str = 'undefined') => { + if (typeof str !== 'string') { + throw new Error( + `Wrong type for parameter "str" ("${str}"): Must be of type string`, + 'lib/getLicenseTitle.js', + 24, + ); + } + + let match; + let version; + + try { + // Simply check if the string is a valid SPDX expression: + spdx_expression_parse(str); + + // No need for additional parsing efforts: + return str; + } catch (error) { + // Fail silently and continue with additional parsing efforts: + } + + if (str) { + str = str.replace('\n', ''); + } + + if (!str || str === 'undefined') { + return 'Undefined'; + } + + if (ZERO_PARITY_LICENSE.test(str)) { + return 'Zero Parity*'; + } + + if (ISC_LICENSE.test(str)) { + return 'ISC*'; + } + + if (HIPPOCRATIC_LICENSE.test(str)) { + return 'Hippocratic-2.1*'; + } + + if (MIT_LICENSE.test(str)) { + return 'MIT*'; + } + + if (BSD_LICENSE.test(str)) { + return 'BSD*'; + } + + if (BSD_SOURCE_CODE_LICENSE.test(str)) { + // https://spdx.org/licenses/BSD-Source-Code.html + return 'BSD-Source-Code*'; + } + + if (WTFPL_LICENSE.test(str)) { + return 'WTFPL*'; + } + + if (ISC.test(str)) { + return 'ISC*'; + } + + if (MIT.test(str)) { + return 'MIT*'; + } + + if (BSD.test(str)) { + return 'BSD*'; + } + + if (WTFPL.test(str)) { + return 'WTFPL*'; + } + + if (APACHE_VERSION.test(str)) { + match = APACHE_VERSION.exec(str); + version = match[1]; + + if (version.length === 1) { + version = version + '.0'; } - // resolve and split root, and then add to the store. - // this is the only time we call path.resolve() - const cwdPath = pathImpl.resolve(cwd); - this.roots = Object.create(null); - this.rootPath = this.parseRootPath(cwdPath); - this.#resolveCache = new ResolveCache(); - this.#resolvePosixCache = new ResolveCache(); - this.#children = new ChildrenCache(childrenCacheSize); - const split = cwdPath.substring(this.rootPath.length).split(sep); - // resolve('/') leaves '', splits to [''], we don't want that. - if (split.length === 1 && !split[0]) { - split.pop(); + + return 'Apache-' + version + '*'; + } + + if (APACHE.test(str)) { + return 'Apache*'; + } + + if (APACHE_VERSION_SHORT.test(str)) { + match = APACHE_VERSION_SHORT.exec(str); + version = match[1]; + + if (version.length === 1) { + version = version + '.0'; } - /* c8 ignore start */ - if (nocase === undefined) { - throw new TypeError('must provide nocase setting to PathScurryBase ctor'); + + return 'Apache-' + version + '*'; + } + + if (CC0_1_0.test(str)) { + return 'CC0-1.0*'; + } + + if (GPL.test(str)) { + match = GPL.exec(str); + version = match[1]; + + /*istanbul ignore else*/ + if (version.length === 1) { + version = version + '.0'; } - /* c8 ignore stop */ - this.nocase = nocase; - this.root = this.newRoot(this.#fs); - this.roots[this.rootPath] = this.root; - let prev = this.root; - let len = split.length - 1; - const joinSep = pathImpl.sep; - let abs = this.rootPath; - let sawFirst = false; - for (const part of split) { - const l = len--; - prev = prev.child(part, { - relative: new Array(l).fill('..').join(joinSep), - relativePosix: new Array(l).fill('..').join('/'), - fullpath: (abs += (sawFirst ? '' : joinSep) + part), - }); - sawFirst = true; + + return 'GPL-' + version + '*'; + } + + if (LGPL.test(str)) { + match = LGPL.exec(str); + version = match[1]; + + if (version.length === 1) { + version = version + '.0'; } - this.cwd = prev; + return 'LGPL-' + version + '*'; + } + + if (PUBLIC_DOMAIN.test(str)) { + return 'Public Domain'; + } + + if (UNLICENSED.test(str)) { + return 'UNLICENSED'; + } + + match = IS_URL.exec(str) || IS_FILE_REFERENCE.exec(str); + + if (match) { + const matchedUrl = match[1]; + CONTAINS_LICENSE_TERM.lastIndex = 0; + CONTAINS_URLS_ENDING_WITH.lastIndex = 0; + + if (CONTAINS_LICENSE_TERM.test(str) && !CONTAINS_URLS_ENDING_WITH.test(matchedUrl)) { + return `Custom: ${matchedUrl}`; + } + } + + return null; +}; + + + +;// CONCATENATED MODULE: ./node_modules/license-checker-rseidelsohn/lib/license-files.js + + +const BASENAMES_PRECEDENCE = [ + /^LICENSE$/, + /^LICENSE\-\w+$/, // e.g. LICENSE-MIT + /^LICENCE$/, + /^LICENCE\-\w+$/, // e.g. LICENCE-MIT + /^MIT-LICENSE$/, + /^COPYING$/, + /^README$/, // TODO: should we really include README? +]; + +// Find and list license files in the precedence order +const licenseFiles = (dirFiles) => { + const files = []; + + BASENAMES_PRECEDENCE.forEach((basenamePattern) => { + dirFiles.some((filename) => { + const basename = external_node_path_.basename(filename, external_node_path_.extname(filename)).toUpperCase(); + + if (basenamePattern.test(basename)) { + files.push(filename); + return true; + } + + return false; + }); + }); + + return files; +}; + + +;// CONCATENATED MODULE: ./node_modules/license-checker-rseidelsohn/lib/indexHelpers.js + + + +/** + * ! This function has a wanted sideeffect, as it modifies the json object that is passed by reference. + * + * The depth attribute set in the options parameter here - which is defined by setting the `--direct` flag - is of + * no use with npm < 3, as the older npm versions flattened all dependencies into one single directory. So in + * order to making `--direct` work with older versions of npm, we need to filter out all non-dependencies from + * the json result. + */ +// TODO: Add tests for this function +const deleteNonDirectDependenciesFromAllDependencies = function deleteNonDirectDependenciesFromAllDependencies( + { _dependencies: directDependencies = {}, dependencies: allDependencies = {}, devDependencies = {} } = {}, + options, +) { + const allDependenciesArray = Object.keys(allDependencies); + const directDependenciesArray = Object.keys(directDependencies); + const devDependenciesArray = Object.keys(devDependencies); + let wantedDependenciesArray = []; + + if (options.production && !options.development) { + wantedDependenciesArray = directDependenciesArray.filter( + (directDependency) => !devDependenciesArray.includes(directDependency), + ); + } else if (!options.production && options.development) { + wantedDependenciesArray = devDependenciesArray; + } else { + wantedDependenciesArray = directDependenciesArray; + } + + allDependenciesArray.forEach((currentDependency) => { + if (!wantedDependenciesArray.includes(currentDependency)) { + delete allDependencies[currentDependency]; + } + }); +}; + +const getRepositoryUrl = function getRepositoryUrl({ clarificationRepository, jsonRepository }) { + if (clarificationRepository) { + return clarificationRepository; + } + + if (typeof jsonRepository?.url === 'string') { + return jsonRepository.url + .replace('git+ssh://git@', 'git://') + .replace('git+https://github.com', 'https://github.com') + .replace('git://github.com', 'https://github.com') + .replace('git@github.com:', 'https://github.com/') + .replace(/\.git$/, ''); } - /** - * Get the depth of a provided path, string, or the cwd - */ - depth(path = this.cwd) { - if (typeof path === 'string') { - path = this.cwd.resolve(path); + + return undefined; +}; + +const getFirstNotUndefinedOrUndefined = function getFirstNotUndefinedOrUndefined() { + for (let i = 0; i < arguments.length; i++) { + if (typeof arguments[i] !== 'undefined') { + return arguments[i]; } - return path.depth(); } - /** - * Return the cache of child entries. Exposed so subclasses can create - * child Path objects in a platform-specific way. - * - * @internal - */ - childrenCache() { - return this.#children; + + return undefined; +}; + +const getAuthorDetails = function getAuthorDetails({ clarification, author }) { + let publisher = getFirstNotUndefinedOrUndefined(clarification?.publisher, author?.name); + let email = getFirstNotUndefinedOrUndefined(clarification?.email, author?.email); + let url = getFirstNotUndefinedOrUndefined(clarification?.url, author?.url); + + return { publisher, email, url }; +}; + +const getLinesWithCopyright = function getLinesWithCopyright(fileContents = '') { + return fileContents + .replace(/\r\n/g, '\n') + .split('\n\n') + .filter(function selectCopyRightStatements(value) { + return ( + value.startsWith('opyright', 1) && // include copyright statements + !value.startsWith('opyright notice', 1) && // exclude lines from from license text + !value.startsWith('opyright and related rights', 1) + ); + }) + .filter(function removeDuplicates(value, index, list) { + return index === 0 || value !== list[0]; + }); +}; + +const getOptionArray = (option) => { + if (Array.isArray(option)) { + return option; } - /** - * Resolve one or more path strings to a resolved string - * - * Same interface as require('path').resolve. - * - * Much faster than path.resolve() when called multiple times for the same - * path, because the resolved Path objects are cached. Much slower - * otherwise. - */ - resolve(...paths) { - // first figure out the minimum number of paths we have to test - // we always start at cwd, but any absolutes will bump the start - let r = ''; - for (let i = paths.length - 1; i >= 0; i--) { - const p = paths[i]; - if (!p || p === '.') - continue; - r = r ? `${p}/${r}` : p; - if (this.isAbsolute(p)) { - break; - } - } - const cached = this.#resolveCache.get(r); - if (cached !== undefined) { - return cached; - } - const result = this.cwd.resolve(r).fullpath(); - this.#resolveCache.set(r, result); - return result; + + if (typeof option === 'string') { + return option.split(';'); } - /** - * Resolve one or more path strings to a resolved string, returning - * the posix path. Identical to .resolve() on posix systems, but on - * windows will return a forward-slash separated UNC path. - * - * Same interface as require('path').resolve. - * - * Much faster than path.resolve() when called multiple times for the same - * path, because the resolved Path objects are cached. Much slower - * otherwise. - */ - resolvePosix(...paths) { - // first figure out the minimum number of paths we have to test - // we always start at cwd, but any absolutes will bump the start - let r = ''; - for (let i = paths.length - 1; i >= 0; i--) { - const p = paths[i]; - if (!p || p === '.') - continue; - r = r ? `${p}/${r}` : p; - if (this.isAbsolute(p)) { - break; - } + + return false; +}; + +const getCsvData = (sorted, customFormat, csvComponentPrefix) => { + const csvDataArr = []; + + Object.entries(sorted).forEach(([key, module]) => { + const dataElements = []; + + if (csvComponentPrefix) { + dataElements.push(`"${csvComponentPrefix}"`); } - const cached = this.#resolvePosixCache.get(r); - if (cached !== undefined) { - return cached; + + // Grab the custom keys from the custom format + if (typeof customFormat === 'object' && Object.keys(customFormat).length > 0) { + dataElements.push(`"${key}"`); + + Object.keys(customFormat).forEach((item) => { + dataElements.push(`"${module[item]}"`); + }); + } else { + // Be sure to push empty strings for empty values, as this is what CSV expects: + dataElements.push([`"${key}"`, `"${module.licenses || ''}"`, `"${module.repository || ''}"`]); } - const result = this.cwd.resolve(r).fullpathPosix(); - this.#resolvePosixCache.set(r, result); - return result; + + csvDataArr.push(dataElements.join(',')); + }); + + return csvDataArr; +}; + +const getCsvHeaders = (customFormat, csvComponentPrefix) => { + const prefixName = '"component"'; + const entriesArr = []; + + if (csvComponentPrefix) { + entriesArr.push(prefixName); } - /** - * find the relative path from the cwd to the supplied path string or entry - */ - relative(entry = this.cwd) { - if (typeof entry === 'string') { - entry = this.cwd.resolve(entry); - } - return entry.relative(); + + if (typeof customFormat === 'object' && Object.keys(customFormat).length > 0) { + entriesArr.push('"module name"'); + + Object.keys(customFormat).forEach((item) => { + entriesArr.push(`"${item}"`); + }); + } else { + entriesArr.push('"module name"', '"license"', '"repository"'); } - /** - * find the relative path from the cwd to the supplied path string or - * entry, using / as the path delimiter, even on Windows. - */ - relativePosix(entry = this.cwd) { - if (typeof entry === 'string') { - entry = this.cwd.resolve(entry); - } - return entry.relativePosix(); + + return entriesArr.join(','); +}; + +const getModuleNameForLicenseTextHeader = (moduleName = '') => { + const lastIndexOfAtCharacter = moduleName.lastIndexOf('@'); + + return `${moduleName.substring(0, lastIndexOfAtCharacter)} ${moduleName.substring(lastIndexOfAtCharacter + 1)}\n`; +}; + +// Eventually store the contents of the module's README.md in currentExtendedPackageJson.readme: +const storeReadmeInJsonIfExists = (modulePath, currentExtendedPackageJson) => { + if ( + typeof modulePath !== 'string' || + typeof currentExtendedPackageJson !== 'object' || + modulePath === '' || + (typeof currentExtendedPackageJson?.readme === 'string' && + currentExtendedPackageJson?.readme?.toLowerCase()?.indexOf('no readme data found') === -1) + ) { + return; } - /** - * Return the basename for the provided string or Path object - */ - basename(entry = this.cwd) { - if (typeof entry === 'string') { - entry = this.cwd.resolve(entry); - } - return entry.name; + + const readmeFile = external_node_path_.join(modulePath, 'README.md'); + + if (external_node_fs_.existsSync(readmeFile)) { + currentExtendedPackageJson.readme = external_node_fs_.readFileSync(readmeFile, 'utf8').toString(); } - /** - * Return the dirname for the provided string or Path object - */ - dirname(entry = this.cwd) { - if (typeof entry === 'string') { - entry = this.cwd.resolve(entry); - } - return (entry.parent || entry).fullpath(); +}; + + + +;// CONCATENATED MODULE: ./node_modules/license-checker-rseidelsohn/lib/index.js +/* +Copyright (c) 2013, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://yuilibrary.com/license/ +*/ + +const LICENSE_TITLE_UNKNOWN = 'UNKNOWN'; +const LICENSE_TITLE_UNLICENSED = 'UNLICENSED'; +const INITIAL_MODULE_INFO = { + licenses: LICENSE_TITLE_UNKNOWN, +}; + + + + + + + + + + + + + + + + + + +// Set up debug logging +// https://www.npmjs.com/package/debug#stderr-vs-stdout +const debugError = src('license-checker-rseidelsohn:error'); +const debugLog = src('license-checker-rseidelsohn:log'); + +debugLog.log = console.log.bind(console); + +// This function calls itself recursively. On the first iteration, it collects the data of the main program, during the +// second iteration, it collects the data from all direct dependencies, then it collects their dependencies and so on. +const recursivelyCollectAllDependencies = (options) => { + const { color: colorize, deps: currentExtendedPackageJson, unknown } = options; + const moduleInfo = { ...INITIAL_MODULE_INFO }; + const currentPackageNameAndVersion = `${currentExtendedPackageJson.name}@${currentExtendedPackageJson.version}`; + + let { data } = options; + let licenseFilesInCurrentModuleDirectory = []; + let licenseData; + let licenseFile; + let noticeFiles = []; + const clarification = options.clarifications[currentExtendedPackageJson.name]?.find( + (clarification) => + currentExtendedPackageJson.version === clarification.semverRange || + semver.satisfies(currentExtendedPackageJson.version, clarification.semverRange), + ); + let passedClarificationCheck = clarification?.checksum ? false : true; + if (clarification) { + clarification.used = true; } - async readdir(entry = this.cwd, opts = { - withFileTypes: true, - }) { - if (typeof entry === 'string') { - entry = this.cwd.resolve(entry); - } - else if (!(entry instanceof PathBase)) { - opts = entry; - entry = this.cwd; - } - const { withFileTypes } = opts; - if (!entry.canReaddir()) { - return []; - } - else { - const p = await entry.readdir(); - return withFileTypes ? p : p.map(e => e.name); - } + + if ( + // If we have processed this currentPackageNameAndVersion already, just return the data object. + // This was added so that we don't recurse forever if there was a circular + // dependency in the dependency tree. + data[currentPackageNameAndVersion] || + (options.production && currentExtendedPackageJson.extraneous) || + (options.development && !currentExtendedPackageJson.extraneous && !currentExtendedPackageJson.root) + ) { + return data; } - readdirSync(entry = this.cwd, opts = { - withFileTypes: true, - }) { - if (typeof entry === 'string') { - entry = this.cwd.resolve(entry); - } - else if (!(entry instanceof PathBase)) { - opts = entry; - entry = this.cwd; - } - const { withFileTypes = true } = opts; - if (!entry.canReaddir()) { - return []; - } - else if (withFileTypes) { - return entry.readdirSync(); - } - else { - return entry.readdirSync().map(e => e.name); - } + + if (currentExtendedPackageJson.private) { + moduleInfo.private = true; } - /** - * Call lstat() on the string or Path object, and update all known - * information that can be determined. - * - * Note that unlike `fs.lstat()`, the returned value does not contain some - * information, such as `mode`, `dev`, `nlink`, and `ino`. If that - * information is required, you will need to call `fs.lstat` yourself. - * - * If the Path refers to a nonexistent file, or if the lstat call fails for - * any reason, `undefined` is returned. Otherwise the updated Path object is - * returned. - * - * Results are cached, and thus may be out of date if the filesystem is - * mutated. - */ - async lstat(entry = this.cwd) { - if (typeof entry === 'string') { - entry = this.cwd.resolve(entry); + + data[currentPackageNameAndVersion] = moduleInfo; + + // Include property in output unless custom format has set property explicitly to false: + const mustInclude = (propertyName = '') => options?.customFormat?.[propertyName] !== false; + + if (mustInclude('repository')) { + const repositoryUrl = getRepositoryUrl({ + clarificationRepository: clarification?.repository, + jsonRepository: currentExtendedPackageJson?.repository, + }); + + if (repositoryUrl) { + moduleInfo.repository = repositoryUrl; } - return entry.lstat(); } - /** - * synchronous {@link PathScurryBase.lstat} - */ - lstatSync(entry = this.cwd) { - if (typeof entry === 'string') { - entry = this.cwd.resolve(entry); + + if (mustInclude('url')) { + // TODO: Figure out where the check for currentExtendedPackageJson.url.web comes from. It's in the original license-checker, + // but I can't find any documentation on it. + let url = getFirstNotUndefinedOrUndefined(clarification?.url, currentExtendedPackageJson?.url?.web); + /*istanbul ignore next*/ + if (url) { + moduleInfo.url = url; } - return entry.lstatSync(); } - async readlink(entry = this.cwd, { withFileTypes } = { - withFileTypes: false, - }) { - if (typeof entry === 'string') { - entry = this.cwd.resolve(entry); - } - else if (!(entry instanceof PathBase)) { - withFileTypes = entry.withFileTypes; - entry = this.cwd; + + if (typeof currentExtendedPackageJson.author === 'object') { + const { publisher, email, url } = getAuthorDetails({ + clarification, + author: currentExtendedPackageJson?.author, + }); + + if (mustInclude('publisher') && publisher) { + moduleInfo.publisher = publisher; } - const e = await entry.readlink(); - return withFileTypes ? e : e?.fullpath(); - } - readlinkSync(entry = this.cwd, { withFileTypes } = { - withFileTypes: false, - }) { - if (typeof entry === 'string') { - entry = this.cwd.resolve(entry); + + if (mustInclude('email') && email) { + moduleInfo.email = email; } - else if (!(entry instanceof PathBase)) { - withFileTypes = entry.withFileTypes; - entry = this.cwd; + + // moduleInfo.url can for some reason already be set to currentExtendedPackageJson.url.web further up in the code, + // so we only set it if it's not already set. + if (typeof moduleInfo.url !== 'undefined' && mustInclude('url') && url) { + moduleInfo.url = url; } - const e = entry.readlinkSync(); - return withFileTypes ? e : e?.fullpath(); } - async realpath(entry = this.cwd, { withFileTypes } = { - withFileTypes: false, - }) { - if (typeof entry === 'string') { - entry = this.cwd.resolve(entry); - } - else if (!(entry instanceof PathBase)) { - withFileTypes = entry.withFileTypes; - entry = this.cwd; - } - const e = await entry.realpath(); - return withFileTypes ? e : e?.fullpath(); + + /*istanbul ignore next*/ + if (unknown) { + moduleInfo.dependencyPath = currentExtendedPackageJson.path; } - realpathSync(entry = this.cwd, { withFileTypes } = { - withFileTypes: false, - }) { - if (typeof entry === 'string') { - entry = this.cwd.resolve(entry); - } - else if (!(entry instanceof PathBase)) { - withFileTypes = entry.withFileTypes; - entry = this.cwd; - } - const e = entry.realpathSync(); - return withFileTypes ? e : e?.fullpath(); + + const modulePath = getFirstNotUndefinedOrUndefined(clarification?.path, currentExtendedPackageJson?.path); + if (mustInclude('path') && typeof modulePath === 'string') { + moduleInfo.path = modulePath; } - async walk(entry = this.cwd, opts = {}) { - if (typeof entry === 'string') { - entry = this.cwd.resolve(entry); - } - else if (!(entry instanceof PathBase)) { - opts = entry; - entry = this.cwd; + + // Eventually store the contents of the module's README.md in currentExtendedPackageJson.readme: + storeReadmeInJsonIfExists(modulePath, currentExtendedPackageJson); + + // console.log('licenseData: %s', licenseData); + + // Try to get the license information from the clarification file or from the package.json file: + licenseData = getFirstNotUndefinedOrUndefined( + clarification?.licenses, + currentExtendedPackageJson.license, + currentExtendedPackageJson.licenses, + ); + + if (licenseData) { + // License information has been collected from either the clarification file or from the package.json file + /*istanbul ignore else*/ + if (Array.isArray(licenseData) && licenseData.length > 0) { + moduleInfo.licenses = licenseData.map((moduleLicense) => { + const moduleLicenseTypeOrName = getFirstNotUndefinedOrUndefined( + moduleLicense.type, + moduleLicense.name, + ); + + if (typeof moduleLicenseTypeOrName === 'string') { + return moduleLicenseTypeOrName; + } + + if (typeof moduleLicense === 'string') { + return moduleLicense; + } + }); + } else if (typeof getFirstNotUndefinedOrUndefined(licenseData.type, licenseData.name) === 'string') { + moduleInfo.licenses = getLicenseTitle( + getFirstNotUndefinedOrUndefined(licenseData.type, licenseData.name), + ); + } else if (typeof licenseData === 'string') { + moduleInfo.licenses = getLicenseTitle(licenseData); } - const { withFileTypes = true, follow = false, filter, walkFilter, } = opts; - const results = []; - if (!filter || filter(entry)) { - results.push(withFileTypes ? entry : entry.fullpath()); + } else if (getLicenseTitle(currentExtendedPackageJson.readme)) { + // Try to get the license information from the README file if neither the clarification file nor the package.json + // file contained any license information: + moduleInfo.licenses = getLicenseTitle(currentExtendedPackageJson.readme); + } + + if (Array.isArray(moduleInfo.licenses)) { + /*istanbul ignore else*/ + if (moduleInfo.licenses.length === 1) { + moduleInfo.licenses = moduleInfo.licenses[0]; } - const dirs = new Set(); - const walk = (dir, cb) => { - dirs.add(dir); - dir.readdirCB((er, entries) => { - /* c8 ignore start */ - if (er) { - return cb(er); - } - /* c8 ignore stop */ - let len = entries.length; - if (!len) - return cb(); - const next = () => { - if (--len === 0) { - cb(); + } + + /*istanbul ignore else*/ + if (clarification?.licenseFile) { + licenseFilesInCurrentModuleDirectory = [clarification.licenseFile]; + } else if (external_node_fs_.existsSync(modulePath)) { + const filesInModuleDirectory = external_node_fs_.readdirSync(modulePath); + licenseFilesInCurrentModuleDirectory = licenseFiles(filesInModuleDirectory); + + noticeFiles = filesInModuleDirectory.filter((filename) => { + filename = filename.toUpperCase(); + const name = external_node_path_.basename(filename).replace(external_node_path_.extname(filename), ''); + + return name === 'NOTICE'; + }); + } + + // console.log('licenseFilesInCurrentModuleDirectory before: %s', licenseFilesInCurrentModuleDirectory); + + licenseFilesInCurrentModuleDirectory.forEach(function findBetterLicenseData(filename, index) { + licenseFile = external_node_path_.join(modulePath, filename); + // Checking that the file is in fact a normal file and not a directory for example. + /*istanbul ignore else*/ + if (external_node_fs_.lstatSync(licenseFile).isFile()) { + let currentLicenceFilesContent; + + if ( + !moduleInfo.licenses || + moduleInfo.licenses.indexOf(LICENSE_TITLE_UNKNOWN) > -1 + // TODO: Should we override a custom license? + // || moduleInfo.licenses.indexOf('Custom:') === 0 + ) { + //Only re-check the license if we didn't get it from elsewhere + currentLicenceFilesContent = external_node_fs_.readFileSync(licenseFile, { encoding: 'utf8' }); + + moduleInfo.licenses = getLicenseTitle(currentLicenceFilesContent); + } + + if (index === 0) { + // Treat the file with the highest precedence as licenseFile + if (clarification !== undefined && !passedClarificationCheck) { + /*istanbul ignore else*/ + if (!currentLicenceFilesContent) { + currentLicenceFilesContent = external_node_fs_.readFileSync(licenseFile, { encoding: 'utf8' }); } - }; - for (const e of entries) { - if (!filter || filter(e)) { - results.push(withFileTypes ? e : e.fullpath()); + + let sha256 = (0,external_crypto_.createHash)('sha256').update(currentLicenceFilesContent).digest('hex'); + + if (clarification.checksum !== sha256) { + console.error( + `Clarification checksum mismatch for ${currentPackageNameAndVersion} :(\nFile checked: ${licenseFile}`, + ); + process.exit(1); + } else { + passedClarificationCheck = true; } - if (follow && e.isSymbolicLink()) { - e.realpath() - .then(r => (r?.isUnknown() ? r.lstat() : r)) - .then(r => r?.shouldWalk(dirs, walkFilter) ? walk(r, next) : next()); + } + + /*istanbul ignore else*/ + if (mustInclude('licenseFile')) { + moduleInfo.licenseFile = getFirstNotUndefinedOrUndefined( + clarification?.licenseFile, + options.basePath ? external_node_path_.relative(options.basePath, licenseFile) : licenseFile, + ); + } + + if (mustInclude('licenseText') && options.customFormat) { + if (clarification?.licenseText) { + moduleInfo.licenseText = clarification.licenseText; + } else { + if (!currentLicenceFilesContent) { + currentLicenceFilesContent = external_node_fs_.readFileSync(licenseFile, { encoding: 'utf8' }); + } + + /*istanbul ignore else*/ + if (options._args && !options._args.csv) { + moduleInfo.licenseText = currentLicenceFilesContent.trim(); + } else { + moduleInfo.licenseText = currentLicenceFilesContent + .replace(/"/g, "'") + .replace(/\r?\n|\r/g, ' ') + .trim(); + } } - else { - if (e.shouldWalk(dirs, walkFilter)) { - walk(e, next); + + if (clarification?.licenseStart) { + let startIndex = moduleInfo.licenseText.indexOf(clarification.licenseStart); + let endIndex; + + if (clarification?.licenseEnd) { + endIndex = moduleInfo.licenseText.indexOf(clarification.licenseEnd, startIndex); + } else { + endIndex = moduleInfo.licenseText.length; } - else { - next(); + + moduleInfo.licenseText = moduleInfo.licenseText.substring(startIndex, endIndex); + } + } + + if (mustInclude('copyright') && options.customFormat) { + if (clarification?.copyright) { + moduleInfo.copyright = clarification.copyright; + } else { + if (!currentLicenceFilesContent) { + currentLicenceFilesContent = external_node_fs_.readFileSync(licenseFile, { encoding: 'utf8' }); + } + + const linesWithCopyright = getLinesWithCopyright(currentLicenceFilesContent); + + if (linesWithCopyright.length > 0) { + moduleInfo.copyright = linesWithCopyright[0].replace(/\n/g, '. ').trim(); + } + + // Mark files with multiple copyright statements. This might be + // an indicator to take a closer look at the LICENSE file. + if (linesWithCopyright.length > 1) { + moduleInfo.copyright = `${moduleInfo.copyright}*`; } } } - }, true); // zalgooooooo - }; - const start = entry; - return new Promise((res, rej) => { - walk(start, er => { - /* c8 ignore start */ - if (er) - return rej(er); - /* c8 ignore stop */ - res(results); + } + } + }); + + // console.log('moduleInfo.licenses after: %s', moduleInfo.licenses); + + if (!passedClarificationCheck) { + console.error('All clarifications must come with a checksum'); + process.exit(1); + } + + // TODO: How do clarifications interact with notice files? + noticeFiles.forEach((filename) => { + const file = external_node_path_.join(currentExtendedPackageJson.path, filename); + /*istanbul ignore else*/ + if (external_node_fs_.lstatSync(file).isFile()) { + moduleInfo.noticeFile = options.basePath ? external_node_path_.relative(options.basePath, file) : file; + } + }); + + /*istanbul ignore else*/ + if (currentExtendedPackageJson.dependencies) { + Object.keys(currentExtendedPackageJson.dependencies).forEach((dependencyName) => { + const childDependency = + options.currentRecursionDepth > options._args.direct + ? {} + : currentExtendedPackageJson.dependencies[dependencyName]; + const dependencyId = `${childDependency.name}@${childDependency.version}`; + + if (data[dependencyId]) { + // already exists + return; + } + + data = recursivelyCollectAllDependencies({ + _args: options._args, + basePath: options.basePath, + color: colorize, + customFormat: options.customFormat, + data, + deps: childDependency, + development: options.development, + production: options.production, + unknown, + currentRecursionDepth: options.currentRecursionDepth + 1, + clarifications: options.clarifications, }); }); } - walkSync(entry = this.cwd, opts = {}) { - if (typeof entry === 'string') { - entry = this.cwd.resolve(entry); - } - else if (!(entry instanceof PathBase)) { - opts = entry; - entry = this.cwd; - } - const { withFileTypes = true, follow = false, filter, walkFilter, } = opts; - const results = []; - if (!filter || filter(entry)) { - results.push(withFileTypes ? entry : entry.fullpath()); - } - const dirs = new Set([entry]); - for (const dir of dirs) { - const entries = dir.readdirSync(); - for (const e of entries) { - if (!filter || filter(e)) { - results.push(withFileTypes ? e : e.fullpath()); - } - let r = e; - if (e.isSymbolicLink()) { - if (!(follow && (r = e.realpathSync()))) - continue; - if (r.isUnknown()) - r.lstatSync(); - } - if (r.shouldWalk(dirs, walkFilter)) { - dirs.add(r); - } + + if (!currentExtendedPackageJson.name || !currentExtendedPackageJson.version) { + delete data[currentPackageNameAndVersion]; + } + + /*istanbul ignore next*/ + if (options.customFormat) { + Object.keys(options.customFormat).forEach((customFormatKey) => { + if (mustInclude(customFormatKey) && moduleInfo[customFormatKey] === undefined) { + moduleInfo[customFormatKey] = getFirstNotUndefinedOrUndefined( + clarification?.[customFormatKey], + typeof currentExtendedPackageJson[customFormatKey] === 'string' + ? currentExtendedPackageJson[customFormatKey] + : options.customFormat[customFormatKey], + ); } - } - return results; + }); } - /** - * Support for `for await` - * - * Alias for {@link PathScurryBase.iterate} - * - * Note: As of Node 19, this is very slow, compared to other methods of - * walking. Consider using {@link PathScurryBase.stream} if memory overhead - * and backpressure are concerns, or {@link PathScurryBase.walk} if not. - */ - [Symbol.asyncIterator]() { - return this.iterate(); + + return data; +}; + +const init = (args, callback) => { + debugLog('scanning %s', args.start); + + // customPath is a path to a JSON file that defined a custom format + if (args.customPath) { + args.customFormat = parseJson(args.customPath); } - iterate(entry = this.cwd, options = {}) { - // iterating async over the stream is significantly more performant, - // especially in the warm-cache scenario, because it buffers up directory - // entries in the background instead of waiting for a yield for each one. - if (typeof entry === 'string') { - entry = this.cwd.resolve(entry); - } - else if (!(entry instanceof PathBase)) { - options = entry; - entry = this.cwd; - } - return this.stream(entry, options)[Symbol.asyncIterator](); + + const optionsForReadingInstalledPackages = { + depth: args.direct, // How deep to traverse the dependency tree + nopeer: args.nopeer, // Whether or not to skip peerDependencies in output + dev: true, // Whether or not to include devDependencies + log: debugLog, // A function to log debug info + }; + + if (args.production || args.development) { + optionsForReadingInstalledPackages.dev = false; } - /** - * Iterating over a PathScurry performs a synchronous walk. - * - * Alias for {@link PathScurryBase.iterateSync} - */ - [Symbol.iterator]() { - return this.iterateSync(); + + const toCheckforFailOn = []; + const toCheckforOnlyAllow = []; + let checker; + let pusher; + + if (args.onlyAllow) { + checker = args.onlyAllow; + pusher = toCheckforOnlyAllow; } - *iterateSync(entry = this.cwd, opts = {}) { - if (typeof entry === 'string') { - entry = this.cwd.resolve(entry); + + if (args.failOn) { + checker = args.failOn; + pusher = toCheckforFailOn; + } + + // An object mapping from Package name -> list of what contents it should have, including a semver range for each entry + let clarifications = {}; + if (args.clarificationsFile) { + const clarificationsFromFile = parseJson(args.clarificationsFile); + + for (const [versionString, clarification] of Object.entries(clarificationsFromFile)) { + const versionSplit = versionString.lastIndexOf('@'); + if (versionSplit !== -1) { + const name = versionString.slice(0, versionSplit); + const semverRange = versionString.slice(versionSplit + 1); + clarifications[name] = clarifications[name] || []; + // keep track for each clarification if it was used, optionally error when not + clarifications[name].push({ ...clarification, semverRange, used: false }); + } } - else if (!(entry instanceof PathBase)) { - opts = entry; - entry = this.cwd; + } + + if (checker && pusher) { + checker.split(';').forEach((license) => { + license = license.trim(); + /*istanbul ignore else*/ + if (license.length > 0) { + pusher.push(license); + } + }); + } + + read_installed(args.start, optionsForReadingInstalledPackages, (err, installedPackagesJson) => { + // Good to know: + // The json object returned by readInstalledPackages stores all direct (prod and dev) dependencies from + // the package.json file in the property '_dependencies'. The property 'dependencies' contains all dependencies, + // including the ones that are only required by other dependencies. + if (optionsForReadingInstalledPackages.depth === 0) { + deleteNonDirectDependenciesFromAllDependencies(installedPackagesJson, args); } - const { withFileTypes = true, follow = false, filter, walkFilter, } = opts; - if (!filter || filter(entry)) { - yield withFileTypes ? entry : entry.fullpath(); + + // 'allWantedDepthDependenciesWithVersions' might be longer than 'installedPackagesJson.dependencies', as it appends the version numbers to each key (package name), + // e.g. 'grunt@1' instead of 'grunt', and this way contains all different installed versions of each package: + let allWantedDepthDependenciesWithVersions = recursivelyCollectAllDependencies({ + _args: args, + basePath: args.relativeLicensePath ? installedPackagesJson.path : null, + color: args.color, + customFormat: args.customFormat, + data: {}, + deps: installedPackagesJson, + development: args.development, + production: args.production, + unknown: args.unknown, + currentRecursionDepth: 0, + clarifications, + }); + + if (args.clarificationsMatchAll) { + const unusedClarifications = []; + for (const [packageName, entries] of Object.entries(clarifications)) { + for (const clarification of entries) { + if (!clarification.used) { + unusedClarifications.push(`${packageName}@${clarification.semverRange}`); + } + } + } + if (unusedClarifications.length) { + console.error( + `Some clarifications (${unusedClarifications.join( + ', ', + )}) were unused and --clarificationsMatchAll was specified. Exiting.`, + ); + + process.exit(1); + } } - const dirs = new Set([entry]); - for (const dir of dirs) { - const entries = dir.readdirSync(); - for (const e of entries) { - if (!filter || filter(e)) { - yield withFileTypes ? e : e.fullpath(); + + const colorize = args.color; + const sorted = {}; // 'sorted' will store the same items as allWantedDepthDependenciesWithVersions, but sorted by package name and version + let resultJson = {}; + const excludeLicenses = + args.excludeLicenses && + args.excludeLicenses + .match(/([^\\\][^,]|\\,)+/g) + .map((license) => license.replace(/\\,/g, ',').replace(/^\s+|\s+$/g, '')); + const includeLicenses = + args.includeLicenses && + args.includeLicenses + .match(/([^\\\][^,]|\\,)+/g) + .map((license) => license.replace(/\\,/g, ',').replace(/^\s+|\s+$/g, '')); + let inputError = null; + + const colorizeString = (string) => + /*istanbul ignore next*/ + colorize ? source.bold.red(string) : string; + + const filterDeletePrivatePackages = (privatePackage) => { + /*istanbul ignore next - I don't have access to private packages to test */ + if (resultJson[privatePackage] && resultJson[privatePackage].private) { + delete resultJson[privatePackage]; + } + }; + + const onlyIncludeWhitelist = (whitelist, filtered) => { + const resultJson = {}; + + Object.keys(filtered).map((filteredPackage) => { + // Whitelist packages by declaring: + // 1. the package full name. Ex: `react` (we suffix an '@' to ensure we don't match packages like `react-native`) + // 2. the package full name and the major version. Ex: `react@16` + // 3. the package full name and full version. Ex: `react@16.0.2` + if ( + whitelist.findIndex((whitelistPackage) => + filteredPackage.startsWith( + whitelistPackage.lastIndexOf('@') > 0 ? whitelistPackage : `${whitelistPackage}@`, + ), + ) !== -1 + ) { + resultJson[filteredPackage] = filtered[filteredPackage]; } - let r = e; - if (e.isSymbolicLink()) { - if (!(follow && (r = e.realpathSync()))) - continue; - if (r.isUnknown()) - r.lstatSync(); + }); + + return resultJson; + }; + + const excludeBlacklist = (blacklist, filtered) => { + const resultJson = {}; + + Object.keys(filtered).map((filteredPackage) => { + // Blacklist packages by declaring: + // 1. the package full name. Ex: `react` (we suffix an '@' to ensure we don't match packages like `react-native`) + // 2. the package full name and the major version. Ex: `react@16` + // 3. the package full name and full version. Ex: `react@16.0.2` + if ( + blacklist.findIndex((blacklistPackage) => + filteredPackage.startsWith( + blacklistPackage.lastIndexOf('@') > 0 ? blacklistPackage : `${blacklistPackage}@`, + ), + ) === -1 + ) { + resultJson[filteredPackage] = filtered[filteredPackage]; } - if (r.shouldWalk(dirs, walkFilter)) { - dirs.add(r); + }); + + return resultJson; + }; + + const excludePackagesStartingWith = (blacklist, currentResult) => { + const resultJson = { ...currentResult }; + + for (const pkgName in resultJson) { + for (const denyPrefix of blacklist) { + if (pkgName.startsWith(denyPrefix)) delete resultJson[pkgName]; } } - } - } - stream(entry = this.cwd, opts = {}) { - if (typeof entry === 'string') { - entry = this.cwd.resolve(entry); - } - else if (!(entry instanceof PathBase)) { - opts = entry; - entry = this.cwd; - } - const { withFileTypes = true, follow = false, filter, walkFilter, } = opts; - const results = new minipass_1.Minipass({ objectMode: true }); - if (!filter || filter(entry)) { - results.write(withFileTypes ? entry : entry.fullpath()); - } - const dirs = new Set(); - const queue = [entry]; - let processing = 0; - const process = () => { - let paused = false; - while (!paused) { - const dir = queue.shift(); - if (!dir) { - if (processing === 0) - results.end(); - return; + + return resultJson; + }; + + const exitIfCheckHits = (packageName) => { + const currentLicense = resultJson[packageName]?.licenses; + + if (currentLicense) { + checkForFailOn(currentLicense); + checkForOnlyAllow(currentLicense, packageName); + } + }; + + const checkForFailOn = (currentLicense) => { + if (!Array.isArray(toCheckforFailOn) || toCheckforFailOn.length === 0) { + return; + } + + if (toCheckforFailOn.includes(currentLicense)) { + console.error(`Found license defined by the --failOn flag: "${currentLicense}". Exiting.`); + + process.exit(1); + } + }; + + /** + * Check if the current license contains (eventually among others) at least one of the allowed licenses + * + * @param {string} currentLicense The current license + * @param {string} packageName The package name + */ + const checkForOnlyAllow = (currentLicense, packageName) => { + if (toCheckforOnlyAllow.length > 0) { + let containsOneOfAllowedPackages = false; + + for (const allowedLicense of toCheckforOnlyAllow) { + // "currentLicense" is a longer string that may contain several license names, + // and we check if one of those is a license listed in the "toCheckforOnlyAllow" + // licenses array: + if (currentLicense.includes(allowedLicense)) { + containsOneOfAllowedPackages = true; + break; + } + } + + if (!containsOneOfAllowedPackages) { + console.error( + `Package "${packageName}" is licensed under "${currentLicense}" which is not permitted by the --onlyAllow flag. Exiting.`, + ); + + process.exit(1); + } + } + }; + + const transformBSD = (spdx) => + spdx === 'BSD' ? '(0BSD OR BSD-2-Clause OR BSD-3-Clause OR BSD-4-Clause)' : spdx; + + const invertResultOf = (fn) => (spdx) => !fn(spdx); + + const spdxIsValid = (spdx) => spdx_correct(spdx) === spdx; + + const getLicenseMatch = (licensesArr, filtered, packageName, packageData, compareLicenses) => { + const validSPDXLicenses = compareLicenses.map(transformBSD).filter(spdxIsValid); + const invalidSPDXLicenses = compareLicenses.map(transformBSD).filter(invertResultOf(spdxIsValid)); + const spdxExcluder = `( ${validSPDXLicenses.join(' OR ')} )`; + + let match = false; + + licensesArr.forEach((license) => { + /*istanbul ignore if - just for protection*/ + if (license.indexOf(LICENSE_TITLE_UNKNOWN) >= 0) { + // Necessary due to colorization: + filtered[packageName] = packageData; + } else { + if (license.endsWith('*')) { + license = license.slice(0, -1); + } + + license = transformBSD(license); + + if ( + invalidSPDXLicenses.indexOf(license) >= 0 || + (spdx_correct(license) && + validSPDXLicenses.length > 0 && + spdx_satisfies(spdx_correct(license), spdxExcluder)) + ) { + match = true; + } } - processing++; - dirs.add(dir); - const onReaddir = (er, entries, didRealpaths = false) => { - /* c8 ignore start */ - if (er) - return results.emit('error', er); - /* c8 ignore stop */ - if (follow && !didRealpaths) { - const promises = []; - for (const e of entries) { - if (e.isSymbolicLink()) { - promises.push(e - .realpath() - .then((r) => r?.isUnknown() ? r.lstat() : r)); - } - } - if (promises.length) { - Promise.all(promises).then(() => onReaddir(null, entries, true)); - return; - } + }); + + return match; + }; + + // This following block stores the licenses in the sorted object (before, the sorted object is the empty object): + Object.keys(allWantedDepthDependenciesWithVersions) + .sort() + .forEach((item) => { + if (allWantedDepthDependenciesWithVersions[item].private) { + allWantedDepthDependenciesWithVersions[item].licenses = colorizeString(LICENSE_TITLE_UNLICENSED); + } + + /*istanbul ignore next*/ + if (!allWantedDepthDependenciesWithVersions[item].licenses) { + allWantedDepthDependenciesWithVersions[item].licenses = colorizeString(LICENSE_TITLE_UNKNOWN); + } + + if ( + args.unknown && + allWantedDepthDependenciesWithVersions[item].licenses && + allWantedDepthDependenciesWithVersions[item].licenses !== LICENSE_TITLE_UNKNOWN && + allWantedDepthDependenciesWithVersions[item].licenses.indexOf('*') > -1 + ) { + /*istanbul ignore if*/ + allWantedDepthDependenciesWithVersions[item].licenses = colorizeString(LICENSE_TITLE_UNKNOWN); + } + /*istanbul ignore else*/ + if (allWantedDepthDependenciesWithVersions[item]) { + if (args.relativeModulePath && allWantedDepthDependenciesWithVersions[item].path != null) { + allWantedDepthDependenciesWithVersions[item].path = external_node_path_.relative( + args.start, + allWantedDepthDependenciesWithVersions[item].path, + ); } - for (const e of entries) { - if (e && (!filter || filter(e))) { - if (!results.write(withFileTypes ? e : e.fullpath())) { - paused = true; - } + + if (args.onlyunknown) { + if ( + allWantedDepthDependenciesWithVersions[item].licenses.indexOf('*') > -1 || + allWantedDepthDependenciesWithVersions[item].licenses.indexOf(LICENSE_TITLE_UNKNOWN) > -1 + ) { + sorted[item] = allWantedDepthDependenciesWithVersions[item]; } + } else { + sorted[item] = allWantedDepthDependenciesWithVersions[item]; } - processing--; - for (const e of entries) { - const r = e.realpathCached() || e; - if (r.shouldWalk(dirs, walkFilter)) { - queue.push(r); + } + }); + + // 'allWantedDepthDependenciesWithVersions' is not needed anymore: + allWantedDepthDependenciesWithVersions = null; + + if (!Object.keys(sorted).length) { + err = new Error('No packages found in this path...'); + } + + // This following block stores the entries from the 'sorted' object in the + // resultJson object (before, the resultJson object is the empty object): + if ( + (!Array.isArray(excludeLicenses) || excludeLicenses.length === 0) && + (!Array.isArray(includeLicenses) || includeLicenses.length === 0) + ) { + resultJson = { ...sorted }; + } else { + if (Array.isArray(excludeLicenses) && excludeLicenses.length > 0) { + Object.entries(sorted).forEach(([packageName, packageData]) => { + let { licenses } = packageData; + + /*istanbul ignore if - just for protection*/ + if (!licenses) { + resultJson[packageName] = packageData; + } else { + const licensesArr = Array.isArray(licenses) ? licenses : [licenses]; + const licenseMatch = getLicenseMatch( + licensesArr, + resultJson, + packageName, + packageData, + excludeLicenses, + ); + + if (!licenseMatch) { + resultJson[packageName] = packageData; } } - if (paused && !results.flowing) { - results.once('drain', process); - } - else if (!sync) { - process(); + }); + } + + if (Array.isArray(includeLicenses) && includeLicenses.length > 0) { + Object.entries(sorted).forEach(([packageName, packageData]) => { + let { licenses } = packageData; + + /*istanbul ignore if - just for protection*/ + if (!licenses) { + resultJson[packageName] = packageData; + } else { + const licensesArr = Array.isArray(licenses) ? licenses : [licenses]; + const licenseMatch = getLicenseMatch( + licensesArr, + resultJson, + packageName, + packageData, + includeLicenses, + ); + + if (licenseMatch) { + resultJson[packageName] = packageData; + } } - }; - // zalgo containment - let sync = true; - dir.readdirCB(onReaddir, true); - sync = false; + }); } - }; - process(); - return results; - } - streamSync(entry = this.cwd, opts = {}) { - if (typeof entry === 'string') { - entry = this.cwd.resolve(entry); } - else if (!(entry instanceof PathBase)) { - opts = entry; - entry = this.cwd; + + // package whitelist + const whitelist = getOptionArray(args.includePackages); + if (whitelist) { + resultJson = onlyIncludeWhitelist(whitelist, resultJson); } - const { withFileTypes = true, follow = false, filter, walkFilter, } = opts; - const results = new minipass_1.Minipass({ objectMode: true }); - const dirs = new Set(); - if (!filter || filter(entry)) { - results.write(withFileTypes ? entry : entry.fullpath()); + + // package blacklist + const blacklist = getOptionArray(args.excludePackages); + if (blacklist) { + resultJson = excludeBlacklist(blacklist, resultJson); } - const queue = [entry]; - let processing = 0; - const process = () => { - let paused = false; - while (!paused) { - const dir = queue.shift(); - if (!dir) { - if (processing === 0) - results.end(); - return; - } - processing++; - dirs.add(dir); - const entries = dir.readdirSync(); - for (const e of entries) { - if (!filter || filter(e)) { - if (!results.write(withFileTypes ? e : e.fullpath())) { - paused = true; - } - } - } - processing--; - for (const e of entries) { - let r = e; - if (e.isSymbolicLink()) { - if (!(follow && (r = e.realpathSync()))) - continue; - if (r.isUnknown()) - r.lstatSync(); - } - if (r.shouldWalk(dirs, walkFilter)) { - queue.push(r); - } - } - } - if (paused && !results.flowing) - results.once('drain', process); - }; - process(); - return results; - } - chdir(path = this.cwd) { - const oldCwd = this.cwd; - this.cwd = typeof path === 'string' ? this.cwd.resolve(path) : path; - this.cwd[setAsCwd](oldCwd); + + // exclude by package name starting with a string + const excludeStartStringsArr = getOptionArray(args.excludePackagesStartingWith); + if (excludeStartStringsArr) { + resultJson = excludePackagesStartingWith(excludeStartStringsArr, resultJson); + } + + if (args.excludePrivatePackages) { + Object.keys(resultJson).forEach(filterDeletePrivatePackages); + } + + Object.keys(resultJson).forEach(exitIfCheckHits); + + /*istanbul ignore next*/ + if (err) { + debugError(err); + inputError = err; + } else { + // Output to files, if necessary + writeOutput(args, resultJson); + } + + // Return the callback and variables nicely + callback(inputError, resultJson); + }); +}; + +const filterAttributes = (attributes, json) => { + let filteredJson = json; + + if (attributes) { + filteredJson = {}; + attributes.forEach((attribute) => { + filteredJson[attribute] = json[attribute]; + }); } -} -exports.PathScurryBase = PathScurryBase; + + return filteredJson; +}; + +const print = (sorted) => { + console.log(asTree(sorted)); +}; + +const asTree = (sorted) => treeify.asTree(sorted, true); + +const asSummary = (sorted) => { + const licenseCountMap = new global.Map(); + const licenseCountArray = []; + const sortedLicenseCountObj = {}; + + Object.values(sorted).forEach(({ licenses }) => { + /*istanbul ignore else*/ + if (licenses) { + licenseCountMap.set(licenses, licenseCountMap.get(licenses) + 1 || 1); + } + }); + + licenseCountMap.forEach((count, license) => { + licenseCountArray.push({ license, count }); + }); + + /*istanbul ignore next*/ + licenseCountArray + .sort((a, b) => b.count - a.count) + .forEach(({ license, count }) => { + sortedLicenseCountObj[license] = count; + }); + + return treeify.asTree(sortedLicenseCountObj, true); +}; + +const asCSV = (sorted, customFormat, csvComponentPrefix) => { + const csvHeaders = getCsvHeaders(customFormat, csvComponentPrefix); + const csvDataArr = getCsvData(sorted, customFormat, csvComponentPrefix); + + return [csvHeaders, ...csvDataArr].join('\n'); +}; + /** - * Windows implementation of {@link PathScurryBase} - * - * Defaults to case insensitve, uses `'\\'` to generate path strings. Uses - * {@link PathWin32} for Path objects. + * Exports data as markdown (*.md) file which has it's own syntax. + * @method + * @param {JSON} sorted The sorted JSON data from all packages. + * @param {JSON} customFormat The custom format with information about the needed keys. + * @return {String} The returning plain text. */ -class PathScurryWin32 extends PathScurryBase { - /** - * separator for generating path strings - */ - sep = '\\'; - constructor(cwd = process.cwd(), opts = {}) { - const { nocase = true } = opts; - super(cwd, node_path_1.win32, '\\', { ...opts, nocase }); - this.nocase = nocase; - for (let p = this.cwd; p; p = p.parent) { - p.nocase = this.nocase; - } - } - /** - * @internal - */ - parseRootPath(dir) { - // if the path starts with a single separator, it's not a UNC, and we'll - // just get separator as the root, and driveFromUNC will return \ - // In that case, mount \ on the root from the cwd. - return node_path_1.win32.parse(dir).root.toUpperCase(); - } - /** - * @internal - */ - newRoot(fs) { - return new PathWin32(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs }); - } - /** - * Return true if the provided path string is an absolute path - */ - isAbsolute(p) { - return (p.startsWith('/') || p.startsWith('\\') || /^[a-z]:(\/|\\)/i.test(p)); +const asMarkDown = (sorted, customFormat) => { + let text = []; + + if (customFormat && Object.keys(customFormat).length > 0) { + Object.keys(sorted).forEach((sortedItem) => { + text.push(`- **[${sortedItem}](${sorted[sortedItem].repository})**`); + + Object.keys(customFormat).forEach((customItem) => { + text.push(` - ${customItem}: ${sorted[sortedItem][customItem]}`); + }); + }); + } else { + Object.keys(sorted).forEach((key) => { + const module = sorted[key]; + text.push(`- [${key}](${module.repository}) - ${module.licenses}`); + }); } -} -exports.PathScurryWin32 = PathScurryWin32; + + return text.join('\n'); +}; + /** - * {@link PathScurryBase} implementation for all posix systems other than Darwin. - * - * Defaults to case-sensitive matching, uses `'/'` to generate path strings. - * - * Uses {@link PathPosix} for Path objects. + * Output data in plain vertical format like Angular CLI does: https://angular.io/3rdpartylicenses.txt */ -class PathScurryPosix extends PathScurryBase { - /** - * separator for generating path strings - */ - sep = '/'; - constructor(cwd = process.cwd(), opts = {}) { - const { nocase = false } = opts; - super(cwd, node_path_1.posix, '/', { ...opts, nocase }); - this.nocase = nocase; - } - /** - * @internal - */ - parseRootPath(_dir) { - return '/'; - } - /** - * @internal - */ - newRoot(fs) { - return new PathPosix(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs }); +const asPlainVertical = (sorted) => + Object.entries(sorted) + .map(([moduleName, moduleData]) => { + let licenseText = getModuleNameForLicenseTextHeader(moduleName); + + if (Array.isArray(moduleData.licenses) && moduleData.licenses.length > 0) { + licenseText += moduleData.licenses.map((moduleLicense) => { + /*istanbul ignore else*/ + if (typeof moduleLicense === 'object') { + /*istanbul ignore next*/ + return moduleLicense.type || moduleLicense.name; + } + + /*istanbul ignore next*/ + if (typeof moduleLicense === 'string') { + return moduleLicense; + } + }); + } else if ( + typeof moduleData.licenses === 'object' && + (moduleData.licenses.type || moduleData.licenses.name) + ) { + licenseText += getLicenseTitle(moduleData.licenses.type || moduleData.licenses.name); + } else if (typeof moduleData.licenses === 'string') { + licenseText += getLicenseTitle(moduleData.licenses); + } + + licenseText += '\n'; + + if (Array.isArray(moduleData.licenseFile) && moduleData.licenseFile.length > 0) { + licenseText += moduleData.licenseFile.map((moduleLicense) => { + /*istanbul ignore else*/ + if (typeof moduleLicense === 'object') { + /*istanbul ignore next*/ + return moduleLicense.type || moduleLicense.name; + } + + if (typeof moduleLicense === 'string') { + return moduleLicense; + } + }); + } else if ( + typeof moduleData.licenseFile === 'object' && + (moduleData.licenseFile.type || moduleData.licenseFile.name) + ) { + licenseText += moduleData.licenseFile.type || moduleData.licenseFile.name; + } else if (typeof moduleData.licenseFile === 'string') { + licenseText += external_node_fs_.readFileSync(moduleData.licenseFile, { encoding: 'utf8' }); + } + + return licenseText; + }) + .join('\n\n'); + +const parseJson = (jsonPath) => { + if (typeof jsonPath !== 'string') { + return new Error('The path was not specified for the JSON file to parse.'); } - /** - * Return true if the provided path string is an absolute path - */ - isAbsolute(p) { - return p.startsWith('/'); + + try { + const jsonFileContents = external_node_fs_.readFileSync(jsonPath, { encoding: 'utf8' }); + + return JSON.parse(jsonFileContents); + } catch (err) { + return err; } -} -exports.PathScurryPosix = PathScurryPosix; +}; + +const asFiles = (json, outDir) => { + mkdirp.sync(outDir); + + Object.keys(json).forEach((moduleName) => { + const licenseFile = json[moduleName].licenseFile; + + if (licenseFile && external_node_fs_.existsSync(licenseFile)) { + const fileContents = external_node_fs_.readFileSync(licenseFile); + const outPath = external_node_path_.join(outDir, `${moduleName}-LICENSE.txt`); + const baseDir = external_node_path_.dirname(outPath); + + mkdirp.sync(baseDir); + external_node_fs_.writeFileSync(outPath, fileContents, 'utf8'); + } else { + console.warn(`No license file found for module '${moduleName}'`); + } + }); +}; + /** - * {@link PathScurryBase} implementation for Darwin (macOS) systems. - * - * Defaults to case-insensitive matching, uses `'/'` for generating path - * strings. - * - * Uses {@link PathPosix} for Path objects. + * Write output to a file, if indicated in parsedArgs. */ -class PathScurryDarwin extends PathScurryPosix { - constructor(cwd = process.cwd(), opts = {}) { - const { nocase = true } = opts; - super(cwd, { ...opts, nocase }); +const writeOutput = (parsedArgs, foundLicensesJson) => { + if (parsedArgs.files || parsedArgs.out) { + const formattedOutput = getFormattedOutput(foundLicensesJson, parsedArgs); + + if (parsedArgs.files) { + asFiles(foundLicensesJson, parsedArgs.files); + } + + if (parsedArgs.out) { + const dir = external_node_path_.dirname(parsedArgs.out); + + mkdirp.sync(dir); + external_node_fs_.writeFileSync(parsedArgs.out, formattedOutput, 'utf8'); + } } -} -exports.PathScurryDarwin = PathScurryDarwin; -/** - * Default {@link PathBase} implementation for the current platform. - * - * {@link PathWin32} on Windows systems, {@link PathPosix} on all others. - */ -exports.Path = process.platform === 'win32' ? PathWin32 : PathPosix; -/** - * Default {@link PathScurryBase} implementation for the current platform. - * - * {@link PathScurryWin32} on Windows systems, {@link PathScurryDarwin} on - * Darwin (macOS) systems, {@link PathScurryPosix} on all others. - */ -exports.PathScurry = process.platform === 'win32' ? PathScurryWin32 - : process.platform === 'darwin' ? PathScurryDarwin - : PathScurryPosix; -//# sourceMappingURL=index.js.map +}; + + + /***/ }), @@ -50977,7 +51925,7 @@ exports.PathScurry = process.platform === 'win32' ? PathScurryWin32 /***/ ((module) => { "use strict"; -module.exports = JSON.parse('{"assert":true,"node:assert":[">= 14.18 && < 15",">= 16"],"assert/strict":">= 15","node:assert/strict":">= 16","async_hooks":">= 8","node:async_hooks":[">= 14.18 && < 15",">= 16"],"buffer_ieee754":">= 0.5 && < 0.9.7","buffer":true,"node:buffer":[">= 14.18 && < 15",">= 16"],"child_process":true,"node:child_process":[">= 14.18 && < 15",">= 16"],"cluster":">= 0.5","node:cluster":[">= 14.18 && < 15",">= 16"],"console":true,"node:console":[">= 14.18 && < 15",">= 16"],"constants":true,"node:constants":[">= 14.18 && < 15",">= 16"],"crypto":true,"node:crypto":[">= 14.18 && < 15",">= 16"],"_debug_agent":">= 1 && < 8","_debugger":"< 8","dgram":true,"node:dgram":[">= 14.18 && < 15",">= 16"],"diagnostics_channel":[">= 14.17 && < 15",">= 15.1"],"node:diagnostics_channel":[">= 14.18 && < 15",">= 16"],"dns":true,"node:dns":[">= 14.18 && < 15",">= 16"],"dns/promises":">= 15","node:dns/promises":">= 16","domain":">= 0.7.12","node:domain":[">= 14.18 && < 15",">= 16"],"events":true,"node:events":[">= 14.18 && < 15",">= 16"],"freelist":"< 6","fs":true,"node:fs":[">= 14.18 && < 15",">= 16"],"fs/promises":[">= 10 && < 10.1",">= 14"],"node:fs/promises":[">= 14.18 && < 15",">= 16"],"_http_agent":">= 0.11.1","node:_http_agent":[">= 14.18 && < 15",">= 16"],"_http_client":">= 0.11.1","node:_http_client":[">= 14.18 && < 15",">= 16"],"_http_common":">= 0.11.1","node:_http_common":[">= 14.18 && < 15",">= 16"],"_http_incoming":">= 0.11.1","node:_http_incoming":[">= 14.18 && < 15",">= 16"],"_http_outgoing":">= 0.11.1","node:_http_outgoing":[">= 14.18 && < 15",">= 16"],"_http_server":">= 0.11.1","node:_http_server":[">= 14.18 && < 15",">= 16"],"http":true,"node:http":[">= 14.18 && < 15",">= 16"],"http2":">= 8.8","node:http2":[">= 14.18 && < 15",">= 16"],"https":true,"node:https":[">= 14.18 && < 15",">= 16"],"inspector":">= 8","node:inspector":[">= 14.18 && < 15",">= 16"],"inspector/promises":[">= 19"],"node:inspector/promises":[">= 19"],"_linklist":"< 8","module":true,"node:module":[">= 14.18 && < 15",">= 16"],"net":true,"node:net":[">= 14.18 && < 15",">= 16"],"node-inspect/lib/_inspect":">= 7.6 && < 12","node-inspect/lib/internal/inspect_client":">= 7.6 && < 12","node-inspect/lib/internal/inspect_repl":">= 7.6 && < 12","os":true,"node:os":[">= 14.18 && < 15",">= 16"],"path":true,"node:path":[">= 14.18 && < 15",">= 16"],"path/posix":">= 15.3","node:path/posix":">= 16","path/win32":">= 15.3","node:path/win32":">= 16","perf_hooks":">= 8.5","node:perf_hooks":[">= 14.18 && < 15",">= 16"],"process":">= 1","node:process":[">= 14.18 && < 15",">= 16"],"punycode":">= 0.5","node:punycode":[">= 14.18 && < 15",">= 16"],"querystring":true,"node:querystring":[">= 14.18 && < 15",">= 16"],"readline":true,"node:readline":[">= 14.18 && < 15",">= 16"],"readline/promises":">= 17","node:readline/promises":">= 17","repl":true,"node:repl":[">= 14.18 && < 15",">= 16"],"smalloc":">= 0.11.5 && < 3","_stream_duplex":">= 0.9.4","node:_stream_duplex":[">= 14.18 && < 15",">= 16"],"_stream_transform":">= 0.9.4","node:_stream_transform":[">= 14.18 && < 15",">= 16"],"_stream_wrap":">= 1.4.1","node:_stream_wrap":[">= 14.18 && < 15",">= 16"],"_stream_passthrough":">= 0.9.4","node:_stream_passthrough":[">= 14.18 && < 15",">= 16"],"_stream_readable":">= 0.9.4","node:_stream_readable":[">= 14.18 && < 15",">= 16"],"_stream_writable":">= 0.9.4","node:_stream_writable":[">= 14.18 && < 15",">= 16"],"stream":true,"node:stream":[">= 14.18 && < 15",">= 16"],"stream/consumers":">= 16.7","node:stream/consumers":">= 16.7","stream/promises":">= 15","node:stream/promises":">= 16","stream/web":">= 16.5","node:stream/web":">= 16.5","string_decoder":true,"node:string_decoder":[">= 14.18 && < 15",">= 16"],"sys":[">= 0.4 && < 0.7",">= 0.8"],"node:sys":[">= 14.18 && < 15",">= 16"],"test/reporters":">= 19.9 && < 20.2","node:test/reporters":[">= 18.17 && < 19",">= 19.9",">= 20"],"node:test":[">= 16.17 && < 17",">= 18"],"timers":true,"node:timers":[">= 14.18 && < 15",">= 16"],"timers/promises":">= 15","node:timers/promises":">= 16","_tls_common":">= 0.11.13","node:_tls_common":[">= 14.18 && < 15",">= 16"],"_tls_legacy":">= 0.11.3 && < 10","_tls_wrap":">= 0.11.3","node:_tls_wrap":[">= 14.18 && < 15",">= 16"],"tls":true,"node:tls":[">= 14.18 && < 15",">= 16"],"trace_events":">= 10","node:trace_events":[">= 14.18 && < 15",">= 16"],"tty":true,"node:tty":[">= 14.18 && < 15",">= 16"],"url":true,"node:url":[">= 14.18 && < 15",">= 16"],"util":true,"node:util":[">= 14.18 && < 15",">= 16"],"util/types":">= 15.3","node:util/types":">= 16","v8/tools/arguments":">= 10 && < 12","v8/tools/codemap":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/consarray":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/csvparser":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/logreader":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/profile_view":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/splaytree":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8":">= 1","node:v8":[">= 14.18 && < 15",">= 16"],"vm":true,"node:vm":[">= 14.18 && < 15",">= 16"],"wasi":[">= 13.4 && < 13.5",">= 18.17 && < 19",">= 20"],"node:wasi":[">= 18.17 && < 19",">= 20"],"worker_threads":">= 11.7","node:worker_threads":[">= 14.18 && < 15",">= 16"],"zlib":">= 0.5","node:zlib":[">= 14.18 && < 15",">= 16"]}'); +module.exports = JSON.parse('{"assert":true,"node:assert":[">= 14.18 && < 15",">= 16"],"assert/strict":">= 15","node:assert/strict":">= 16","async_hooks":">= 8","node:async_hooks":[">= 14.18 && < 15",">= 16"],"buffer_ieee754":">= 0.5 && < 0.9.7","buffer":true,"node:buffer":[">= 14.18 && < 15",">= 16"],"child_process":true,"node:child_process":[">= 14.18 && < 15",">= 16"],"cluster":">= 0.5","node:cluster":[">= 14.18 && < 15",">= 16"],"console":true,"node:console":[">= 14.18 && < 15",">= 16"],"constants":true,"node:constants":[">= 14.18 && < 15",">= 16"],"crypto":true,"node:crypto":[">= 14.18 && < 15",">= 16"],"_debug_agent":">= 1 && < 8","_debugger":"< 8","dgram":true,"node:dgram":[">= 14.18 && < 15",">= 16"],"diagnostics_channel":[">= 14.17 && < 15",">= 15.1"],"node:diagnostics_channel":[">= 14.18 && < 15",">= 16"],"dns":true,"node:dns":[">= 14.18 && < 15",">= 16"],"dns/promises":">= 15","node:dns/promises":">= 16","domain":">= 0.7.12","node:domain":[">= 14.18 && < 15",">= 16"],"events":true,"node:events":[">= 14.18 && < 15",">= 16"],"freelist":"< 6","fs":true,"node:fs":[">= 14.18 && < 15",">= 16"],"fs/promises":[">= 10 && < 10.1",">= 14"],"node:fs/promises":[">= 14.18 && < 15",">= 16"],"_http_agent":">= 0.11.1","node:_http_agent":[">= 14.18 && < 15",">= 16"],"_http_client":">= 0.11.1","node:_http_client":[">= 14.18 && < 15",">= 16"],"_http_common":">= 0.11.1","node:_http_common":[">= 14.18 && < 15",">= 16"],"_http_incoming":">= 0.11.1","node:_http_incoming":[">= 14.18 && < 15",">= 16"],"_http_outgoing":">= 0.11.1","node:_http_outgoing":[">= 14.18 && < 15",">= 16"],"_http_server":">= 0.11.1","node:_http_server":[">= 14.18 && < 15",">= 16"],"http":true,"node:http":[">= 14.18 && < 15",">= 16"],"http2":">= 8.8","node:http2":[">= 14.18 && < 15",">= 16"],"https":true,"node:https":[">= 14.18 && < 15",">= 16"],"inspector":">= 8","node:inspector":[">= 14.18 && < 15",">= 16"],"inspector/promises":[">= 19"],"node:inspector/promises":[">= 19"],"_linklist":"< 8","module":true,"node:module":[">= 14.18 && < 15",">= 16"],"net":true,"node:net":[">= 14.18 && < 15",">= 16"],"node-inspect/lib/_inspect":">= 7.6 && < 12","node-inspect/lib/internal/inspect_client":">= 7.6 && < 12","node-inspect/lib/internal/inspect_repl":">= 7.6 && < 12","os":true,"node:os":[">= 14.18 && < 15",">= 16"],"path":true,"node:path":[">= 14.18 && < 15",">= 16"],"path/posix":">= 15.3","node:path/posix":">= 16","path/win32":">= 15.3","node:path/win32":">= 16","perf_hooks":">= 8.5","node:perf_hooks":[">= 14.18 && < 15",">= 16"],"process":">= 1","node:process":[">= 14.18 && < 15",">= 16"],"punycode":">= 0.5","node:punycode":[">= 14.18 && < 15",">= 16"],"querystring":true,"node:querystring":[">= 14.18 && < 15",">= 16"],"readline":true,"node:readline":[">= 14.18 && < 15",">= 16"],"readline/promises":">= 17","node:readline/promises":">= 17","repl":true,"node:repl":[">= 14.18 && < 15",">= 16"],"node:sea":[">= 20.12 && < 21",">= 21.7"],"smalloc":">= 0.11.5 && < 3","node:sqlite":">= 23.4","_stream_duplex":">= 0.9.4","node:_stream_duplex":[">= 14.18 && < 15",">= 16"],"_stream_transform":">= 0.9.4","node:_stream_transform":[">= 14.18 && < 15",">= 16"],"_stream_wrap":">= 1.4.1","node:_stream_wrap":[">= 14.18 && < 15",">= 16"],"_stream_passthrough":">= 0.9.4","node:_stream_passthrough":[">= 14.18 && < 15",">= 16"],"_stream_readable":">= 0.9.4","node:_stream_readable":[">= 14.18 && < 15",">= 16"],"_stream_writable":">= 0.9.4","node:_stream_writable":[">= 14.18 && < 15",">= 16"],"stream":true,"node:stream":[">= 14.18 && < 15",">= 16"],"stream/consumers":">= 16.7","node:stream/consumers":">= 16.7","stream/promises":">= 15","node:stream/promises":">= 16","stream/web":">= 16.5","node:stream/web":">= 16.5","string_decoder":true,"node:string_decoder":[">= 14.18 && < 15",">= 16"],"sys":[">= 0.4 && < 0.7",">= 0.8"],"node:sys":[">= 14.18 && < 15",">= 16"],"test/reporters":">= 19.9 && < 20.2","node:test/reporters":[">= 18.17 && < 19",">= 19.9",">= 20"],"test/mock_loader":">= 22.3 && < 22.7","node:test/mock_loader":">= 22.3 && < 22.7","node:test":[">= 16.17 && < 17",">= 18"],"timers":true,"node:timers":[">= 14.18 && < 15",">= 16"],"timers/promises":">= 15","node:timers/promises":">= 16","_tls_common":">= 0.11.13","node:_tls_common":[">= 14.18 && < 15",">= 16"],"_tls_legacy":">= 0.11.3 && < 10","_tls_wrap":">= 0.11.3","node:_tls_wrap":[">= 14.18 && < 15",">= 16"],"tls":true,"node:tls":[">= 14.18 && < 15",">= 16"],"trace_events":">= 10","node:trace_events":[">= 14.18 && < 15",">= 16"],"tty":true,"node:tty":[">= 14.18 && < 15",">= 16"],"url":true,"node:url":[">= 14.18 && < 15",">= 16"],"util":true,"node:util":[">= 14.18 && < 15",">= 16"],"util/types":">= 15.3","node:util/types":">= 16","v8/tools/arguments":">= 10 && < 12","v8/tools/codemap":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/consarray":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/csvparser":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/logreader":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/profile_view":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/splaytree":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8":">= 1","node:v8":[">= 14.18 && < 15",">= 16"],"vm":true,"node:vm":[">= 14.18 && < 15",">= 16"],"wasi":[">= 13.4 && < 13.5",">= 18.17 && < 19",">= 20"],"node:wasi":[">= 18.17 && < 19",">= 20"],"worker_threads":">= 11.7","node:worker_threads":[">= 14.18 && < 15",">= 16"],"zlib":">= 0.5","node:zlib":[">= 14.18 && < 15",">= 16"]}'); /***/ }), @@ -51009,7 +51957,7 @@ module.exports = JSON.parse('["389-exception","Asterisk-exception","Autoconf-exc /***/ ((module) => { "use strict"; -module.exports = JSON.parse('["AGPL-1.0","AGPL-3.0","BSD-2-Clause-FreeBSD","BSD-2-Clause-NetBSD","GFDL-1.1","GFDL-1.2","GFDL-1.3","GPL-1.0","GPL-1.0+","GPL-2.0","GPL-2.0+","GPL-2.0-with-GCC-exception","GPL-2.0-with-autoconf-exception","GPL-2.0-with-bison-exception","GPL-2.0-with-classpath-exception","GPL-2.0-with-font-exception","GPL-3.0","GPL-3.0+","GPL-3.0-with-GCC-exception","GPL-3.0-with-autoconf-exception","LGPL-2.0","LGPL-2.0+","LGPL-2.1","LGPL-2.1+","LGPL-3.0","LGPL-3.0+","Nunit","StandardML-NJ","bzip2-1.0.5","eCos-2.0","wxWindows"]'); +module.exports = JSON.parse('["AGPL-1.0","AGPL-3.0","BSD-2-Clause-FreeBSD","BSD-2-Clause-NetBSD","GFDL-1.1","GFDL-1.2","GFDL-1.3","GPL-1.0","GPL-2.0","GPL-2.0-with-GCC-exception","GPL-2.0-with-autoconf-exception","GPL-2.0-with-bison-exception","GPL-2.0-with-classpath-exception","GPL-2.0-with-font-exception","GPL-3.0","GPL-3.0-with-GCC-exception","GPL-3.0-with-autoconf-exception","LGPL-2.0","LGPL-2.1","LGPL-3.0","Net-SNMP","Nunit","StandardML-NJ","bzip2-1.0.5","eCos-2.0","wxWindows"]'); /***/ }), @@ -51017,7 +51965,7 @@ module.exports = JSON.parse('["AGPL-1.0","AGPL-3.0","BSD-2-Clause-FreeBSD","BSD- /***/ ((module) => { "use strict"; -module.exports = JSON.parse('["0BSD","AAL","ADSL","AFL-1.1","AFL-1.2","AFL-2.0","AFL-2.1","AFL-3.0","AGPL-1.0-only","AGPL-1.0-or-later","AGPL-3.0-only","AGPL-3.0-or-later","AMDPLPA","AML","AML-glslang","AMPAS","ANTLR-PD","ANTLR-PD-fallback","APAFML","APL-1.0","APSL-1.0","APSL-1.1","APSL-1.2","APSL-2.0","ASWF-Digital-Assets-1.0","ASWF-Digital-Assets-1.1","Abstyles","AdaCore-doc","Adobe-2006","Adobe-Display-PostScript","Adobe-Glyph","Adobe-Utopia","Afmparse","Aladdin","Apache-1.0","Apache-1.1","Apache-2.0","App-s2p","Arphic-1999","Artistic-1.0","Artistic-1.0-Perl","Artistic-1.0-cl8","Artistic-2.0","BSD-1-Clause","BSD-2-Clause","BSD-2-Clause-Darwin","BSD-2-Clause-Patent","BSD-2-Clause-Views","BSD-3-Clause","BSD-3-Clause-Attribution","BSD-3-Clause-Clear","BSD-3-Clause-HP","BSD-3-Clause-LBNL","BSD-3-Clause-Modification","BSD-3-Clause-No-Military-License","BSD-3-Clause-No-Nuclear-License","BSD-3-Clause-No-Nuclear-License-2014","BSD-3-Clause-No-Nuclear-Warranty","BSD-3-Clause-Open-MPI","BSD-3-Clause-Sun","BSD-3-Clause-acpica","BSD-3-Clause-flex","BSD-4-Clause","BSD-4-Clause-Shortened","BSD-4-Clause-UC","BSD-4.3RENO","BSD-4.3TAHOE","BSD-Advertising-Acknowledgement","BSD-Attribution-HPND-disclaimer","BSD-Inferno-Nettverk","BSD-Protection","BSD-Source-Code","BSD-Source-beginning-file","BSD-Systemics","BSD-Systemics-W3Works","BSL-1.0","BUSL-1.1","Baekmuk","Bahyph","Barr","Beerware","BitTorrent-1.0","BitTorrent-1.1","Bitstream-Charter","Bitstream-Vera","BlueOak-1.0.0","Boehm-GC","Borceux","Brian-Gladman-2-Clause","Brian-Gladman-3-Clause","C-UDA-1.0","CAL-1.0","CAL-1.0-Combined-Work-Exception","CATOSL-1.1","CC-BY-1.0","CC-BY-2.0","CC-BY-2.5","CC-BY-2.5-AU","CC-BY-3.0","CC-BY-3.0-AT","CC-BY-3.0-AU","CC-BY-3.0-DE","CC-BY-3.0-IGO","CC-BY-3.0-NL","CC-BY-3.0-US","CC-BY-4.0","CC-BY-NC-1.0","CC-BY-NC-2.0","CC-BY-NC-2.5","CC-BY-NC-3.0","CC-BY-NC-3.0-DE","CC-BY-NC-4.0","CC-BY-NC-ND-1.0","CC-BY-NC-ND-2.0","CC-BY-NC-ND-2.5","CC-BY-NC-ND-3.0","CC-BY-NC-ND-3.0-DE","CC-BY-NC-ND-3.0-IGO","CC-BY-NC-ND-4.0","CC-BY-NC-SA-1.0","CC-BY-NC-SA-2.0","CC-BY-NC-SA-2.0-DE","CC-BY-NC-SA-2.0-FR","CC-BY-NC-SA-2.0-UK","CC-BY-NC-SA-2.5","CC-BY-NC-SA-3.0","CC-BY-NC-SA-3.0-DE","CC-BY-NC-SA-3.0-IGO","CC-BY-NC-SA-4.0","CC-BY-ND-1.0","CC-BY-ND-2.0","CC-BY-ND-2.5","CC-BY-ND-3.0","CC-BY-ND-3.0-DE","CC-BY-ND-4.0","CC-BY-SA-1.0","CC-BY-SA-2.0","CC-BY-SA-2.0-UK","CC-BY-SA-2.1-JP","CC-BY-SA-2.5","CC-BY-SA-3.0","CC-BY-SA-3.0-AT","CC-BY-SA-3.0-DE","CC-BY-SA-3.0-IGO","CC-BY-SA-4.0","CC-PDDC","CC0-1.0","CDDL-1.0","CDDL-1.1","CDL-1.0","CDLA-Permissive-1.0","CDLA-Permissive-2.0","CDLA-Sharing-1.0","CECILL-1.0","CECILL-1.1","CECILL-2.0","CECILL-2.1","CECILL-B","CECILL-C","CERN-OHL-1.1","CERN-OHL-1.2","CERN-OHL-P-2.0","CERN-OHL-S-2.0","CERN-OHL-W-2.0","CFITSIO","CMU-Mach","CMU-Mach-nodoc","CNRI-Jython","CNRI-Python","CNRI-Python-GPL-Compatible","COIL-1.0","CPAL-1.0","CPL-1.0","CPOL-1.02","CUA-OPL-1.0","Caldera","Caldera-no-preamble","ClArtistic","Clips","Community-Spec-1.0","Condor-1.1","Cornell-Lossless-JPEG","Cronyx","Crossword","CrystalStacker","Cube","D-FSL-1.0","DEC-3-Clause","DL-DE-BY-2.0","DL-DE-ZERO-2.0","DOC","DRL-1.0","DRL-1.1","DSDP","Dotseqn","ECL-1.0","ECL-2.0","EFL-1.0","EFL-2.0","EPICS","EPL-1.0","EPL-2.0","EUDatagrid","EUPL-1.0","EUPL-1.1","EUPL-1.2","Elastic-2.0","Entessa","ErlPL-1.1","Eurosym","FBM","FDK-AAC","FSFAP","FSFAP-no-warranty-disclaimer","FSFUL","FSFULLR","FSFULLRWD","FTL","Fair","Ferguson-Twofish","Frameworx-1.0","FreeBSD-DOC","FreeImage","Furuseth","GCR-docs","GD","GFDL-1.1-invariants-only","GFDL-1.1-invariants-or-later","GFDL-1.1-no-invariants-only","GFDL-1.1-no-invariants-or-later","GFDL-1.1-only","GFDL-1.1-or-later","GFDL-1.2-invariants-only","GFDL-1.2-invariants-or-later","GFDL-1.2-no-invariants-only","GFDL-1.2-no-invariants-or-later","GFDL-1.2-only","GFDL-1.2-or-later","GFDL-1.3-invariants-only","GFDL-1.3-invariants-or-later","GFDL-1.3-no-invariants-only","GFDL-1.3-no-invariants-or-later","GFDL-1.3-only","GFDL-1.3-or-later","GL2PS","GLWTPL","GPL-1.0-only","GPL-1.0-or-later","GPL-2.0-only","GPL-2.0-or-later","GPL-3.0-only","GPL-3.0-or-later","Giftware","Glide","Glulxe","Graphics-Gems","HP-1986","HP-1989","HPND","HPND-DEC","HPND-Fenneberg-Livingston","HPND-INRIA-IMAG","HPND-Kevlin-Henney","HPND-MIT-disclaimer","HPND-Markus-Kuhn","HPND-Pbmplus","HPND-UC","HPND-doc","HPND-doc-sell","HPND-export-US","HPND-export-US-modify","HPND-sell-MIT-disclaimer-xserver","HPND-sell-regexpr","HPND-sell-variant","HPND-sell-variant-MIT-disclaimer","HTMLTIDY","HaskellReport","Hippocratic-2.1","IBM-pibs","ICU","IEC-Code-Components-EULA","IJG","IJG-short","IPA","IPL-1.0","ISC","ISC-Veillard","ImageMagick","Imlib2","Info-ZIP","Inner-Net-2.0","Intel","Intel-ACPI","Interbase-1.0","JPL-image","JPNIC","JSON","Jam","JasPer-2.0","Kastrup","Kazlib","Knuth-CTAN","LAL-1.2","LAL-1.3","LGPL-2.0-only","LGPL-2.0-or-later","LGPL-2.1-only","LGPL-2.1-or-later","LGPL-3.0-only","LGPL-3.0-or-later","LGPLLR","LOOP","LPD-document","LPL-1.0","LPL-1.02","LPPL-1.0","LPPL-1.1","LPPL-1.2","LPPL-1.3a","LPPL-1.3c","LZMA-SDK-9.11-to-9.20","LZMA-SDK-9.22","Latex2e","Latex2e-translated-notice","Leptonica","LiLiQ-P-1.1","LiLiQ-R-1.1","LiLiQ-Rplus-1.1","Libpng","Linux-OpenIB","Linux-man-pages-1-para","Linux-man-pages-copyleft","Linux-man-pages-copyleft-2-para","Linux-man-pages-copyleft-var","Lucida-Bitmap-Fonts","MIT","MIT-0","MIT-CMU","MIT-Festival","MIT-Modern-Variant","MIT-Wu","MIT-advertising","MIT-enna","MIT-feh","MIT-open-group","MIT-testregex","MITNFA","MMIXware","MPEG-SSG","MPL-1.0","MPL-1.1","MPL-2.0","MPL-2.0-no-copyleft-exception","MS-LPL","MS-PL","MS-RL","MTLL","Mackerras-3-Clause","Mackerras-3-Clause-acknowledgment","MakeIndex","Martin-Birgmeier","McPhee-slideshow","Minpack","MirOS","Motosoto","MulanPSL-1.0","MulanPSL-2.0","Multics","Mup","NAIST-2003","NASA-1.3","NBPL-1.0","NCGL-UK-2.0","NCSA","NGPL","NICTA-1.0","NIST-PD","NIST-PD-fallback","NIST-Software","NLOD-1.0","NLOD-2.0","NLPL","NOSL","NPL-1.0","NPL-1.1","NPOSL-3.0","NRL","NTP","NTP-0","Naumen","Net-SNMP","NetCDF","Newsletr","Nokia","Noweb","O-UDA-1.0","OCCT-PL","OCLC-2.0","ODC-By-1.0","ODbL-1.0","OFFIS","OFL-1.0","OFL-1.0-RFN","OFL-1.0-no-RFN","OFL-1.1","OFL-1.1-RFN","OFL-1.1-no-RFN","OGC-1.0","OGDL-Taiwan-1.0","OGL-Canada-2.0","OGL-UK-1.0","OGL-UK-2.0","OGL-UK-3.0","OGTSL","OLDAP-1.1","OLDAP-1.2","OLDAP-1.3","OLDAP-1.4","OLDAP-2.0","OLDAP-2.0.1","OLDAP-2.1","OLDAP-2.2","OLDAP-2.2.1","OLDAP-2.2.2","OLDAP-2.3","OLDAP-2.4","OLDAP-2.5","OLDAP-2.6","OLDAP-2.7","OLDAP-2.8","OLFL-1.3","OML","OPL-1.0","OPL-UK-3.0","OPUBL-1.0","OSET-PL-2.1","OSL-1.0","OSL-1.1","OSL-2.0","OSL-2.1","OSL-3.0","OpenPBS-2.3","OpenSSL","OpenSSL-standalone","OpenVision","PADL","PDDL-1.0","PHP-3.0","PHP-3.01","PSF-2.0","Parity-6.0.0","Parity-7.0.0","Pixar","Plexus","PolyForm-Noncommercial-1.0.0","PolyForm-Small-Business-1.0.0","PostgreSQL","Python-2.0","Python-2.0.1","QPL-1.0","QPL-1.0-INRIA-2004","Qhull","RHeCos-1.1","RPL-1.1","RPL-1.5","RPSL-1.0","RSA-MD","RSCPL","Rdisc","Ruby","SAX-PD","SAX-PD-2.0","SCEA","SGI-B-1.0","SGI-B-1.1","SGI-B-2.0","SGI-OpenGL","SGP4","SHL-0.5","SHL-0.51","SISSL","SISSL-1.2","SL","SMLNJ","SMPPL","SNIA","SPL-1.0","SSH-OpenSSH","SSH-short","SSLeay-standalone","SSPL-1.0","SWL","Saxpath","SchemeReport","Sendmail","Sendmail-8.23","SimPL-2.0","Sleepycat","Soundex","Spencer-86","Spencer-94","Spencer-99","SugarCRM-1.1.3","Sun-PPP","SunPro","Symlinks","TAPR-OHL-1.0","TCL","TCP-wrappers","TGPPL-1.0","TMate","TORQUE-1.1","TOSL","TPDL","TPL-1.0","TTWL","TTYP0","TU-Berlin-1.0","TU-Berlin-2.0","TermReadKey","UCAR","UCL-1.0","UMich-Merit","UPL-1.0","URT-RLE","Unicode-3.0","Unicode-DFS-2015","Unicode-DFS-2016","Unicode-TOU","UnixCrypt","Unlicense","VOSTROM","VSL-1.0","Vim","W3C","W3C-19980720","W3C-20150513","WTFPL","Watcom-1.0","Widget-Workshop","Wsuipa","X11","X11-distribute-modifications-variant","XFree86-1.1","XSkat","Xdebug-1.03","Xerox","Xfig","Xnet","YPL-1.0","YPL-1.1","ZPL-1.1","ZPL-2.0","ZPL-2.1","Zed","Zeeff","Zend-2.0","Zimbra-1.3","Zimbra-1.4","Zlib","bcrypt-Solar-Designer","blessing","bzip2-1.0.6","check-cvs","checkmk","copyleft-next-0.3.0","copyleft-next-0.3.1","curl","diffmark","dtoa","dvipdfm","eGenix","etalab-2.0","fwlw","gSOAP-1.3b","gnuplot","gtkbook","hdparm","iMatix","libpng-2.0","libselinux-1.0","libtiff","libutil-David-Nugent","lsof","magaz","mailprio","metamail","mpi-permissive","mpich2","mplus","pnmstitch","psfrag","psutils","python-ldap","radvd","snprintf","softSurfer","ssh-keyscan","swrule","ulem","w3m","xinetd","xkeyboard-config-Zinoviev","xlock","xpp","zlib-acknowledgement"]'); +module.exports = JSON.parse('["0BSD","3D-Slicer-1.0","AAL","ADSL","AFL-1.1","AFL-1.2","AFL-2.0","AFL-2.1","AFL-3.0","AGPL-1.0-only","AGPL-1.0-or-later","AGPL-3.0-only","AGPL-3.0-or-later","AMD-newlib","AMDPLPA","AML","AML-glslang","AMPAS","ANTLR-PD","ANTLR-PD-fallback","APAFML","APL-1.0","APSL-1.0","APSL-1.1","APSL-1.2","APSL-2.0","ASWF-Digital-Assets-1.0","ASWF-Digital-Assets-1.1","Abstyles","AdaCore-doc","Adobe-2006","Adobe-Display-PostScript","Adobe-Glyph","Adobe-Utopia","Afmparse","Aladdin","Apache-1.0","Apache-1.1","Apache-2.0","App-s2p","Arphic-1999","Artistic-1.0","Artistic-1.0-Perl","Artistic-1.0-cl8","Artistic-2.0","BSD-1-Clause","BSD-2-Clause","BSD-2-Clause-Darwin","BSD-2-Clause-Patent","BSD-2-Clause-Views","BSD-2-Clause-first-lines","BSD-3-Clause","BSD-3-Clause-Attribution","BSD-3-Clause-Clear","BSD-3-Clause-HP","BSD-3-Clause-LBNL","BSD-3-Clause-Modification","BSD-3-Clause-No-Military-License","BSD-3-Clause-No-Nuclear-License","BSD-3-Clause-No-Nuclear-License-2014","BSD-3-Clause-No-Nuclear-Warranty","BSD-3-Clause-Open-MPI","BSD-3-Clause-Sun","BSD-3-Clause-acpica","BSD-3-Clause-flex","BSD-4-Clause","BSD-4-Clause-Shortened","BSD-4-Clause-UC","BSD-4.3RENO","BSD-4.3TAHOE","BSD-Advertising-Acknowledgement","BSD-Attribution-HPND-disclaimer","BSD-Inferno-Nettverk","BSD-Protection","BSD-Source-Code","BSD-Source-beginning-file","BSD-Systemics","BSD-Systemics-W3Works","BSL-1.0","BUSL-1.1","Baekmuk","Bahyph","Barr","Beerware","BitTorrent-1.0","BitTorrent-1.1","Bitstream-Charter","Bitstream-Vera","BlueOak-1.0.0","Boehm-GC","Borceux","Brian-Gladman-2-Clause","Brian-Gladman-3-Clause","C-UDA-1.0","CAL-1.0","CAL-1.0-Combined-Work-Exception","CATOSL-1.1","CC-BY-1.0","CC-BY-2.0","CC-BY-2.5","CC-BY-2.5-AU","CC-BY-3.0","CC-BY-3.0-AT","CC-BY-3.0-AU","CC-BY-3.0-DE","CC-BY-3.0-IGO","CC-BY-3.0-NL","CC-BY-3.0-US","CC-BY-4.0","CC-BY-NC-1.0","CC-BY-NC-2.0","CC-BY-NC-2.5","CC-BY-NC-3.0","CC-BY-NC-3.0-DE","CC-BY-NC-4.0","CC-BY-NC-ND-1.0","CC-BY-NC-ND-2.0","CC-BY-NC-ND-2.5","CC-BY-NC-ND-3.0","CC-BY-NC-ND-3.0-DE","CC-BY-NC-ND-3.0-IGO","CC-BY-NC-ND-4.0","CC-BY-NC-SA-1.0","CC-BY-NC-SA-2.0","CC-BY-NC-SA-2.0-DE","CC-BY-NC-SA-2.0-FR","CC-BY-NC-SA-2.0-UK","CC-BY-NC-SA-2.5","CC-BY-NC-SA-3.0","CC-BY-NC-SA-3.0-DE","CC-BY-NC-SA-3.0-IGO","CC-BY-NC-SA-4.0","CC-BY-ND-1.0","CC-BY-ND-2.0","CC-BY-ND-2.5","CC-BY-ND-3.0","CC-BY-ND-3.0-DE","CC-BY-ND-4.0","CC-BY-SA-1.0","CC-BY-SA-2.0","CC-BY-SA-2.0-UK","CC-BY-SA-2.1-JP","CC-BY-SA-2.5","CC-BY-SA-3.0","CC-BY-SA-3.0-AT","CC-BY-SA-3.0-DE","CC-BY-SA-3.0-IGO","CC-BY-SA-4.0","CC-PDDC","CC0-1.0","CDDL-1.0","CDDL-1.1","CDL-1.0","CDLA-Permissive-1.0","CDLA-Permissive-2.0","CDLA-Sharing-1.0","CECILL-1.0","CECILL-1.1","CECILL-2.0","CECILL-2.1","CECILL-B","CECILL-C","CERN-OHL-1.1","CERN-OHL-1.2","CERN-OHL-P-2.0","CERN-OHL-S-2.0","CERN-OHL-W-2.0","CFITSIO","CMU-Mach","CMU-Mach-nodoc","CNRI-Jython","CNRI-Python","CNRI-Python-GPL-Compatible","COIL-1.0","CPAL-1.0","CPL-1.0","CPOL-1.02","CUA-OPL-1.0","Caldera","Caldera-no-preamble","Catharon","ClArtistic","Clips","Community-Spec-1.0","Condor-1.1","Cornell-Lossless-JPEG","Cronyx","Crossword","CrystalStacker","Cube","D-FSL-1.0","DEC-3-Clause","DL-DE-BY-2.0","DL-DE-ZERO-2.0","DOC","DRL-1.0","DRL-1.1","DSDP","DocBook-Schema","DocBook-XML","Dotseqn","ECL-1.0","ECL-2.0","EFL-1.0","EFL-2.0","EPICS","EPL-1.0","EPL-2.0","EUDatagrid","EUPL-1.0","EUPL-1.1","EUPL-1.2","Elastic-2.0","Entessa","ErlPL-1.1","Eurosym","FBM","FDK-AAC","FSFAP","FSFAP-no-warranty-disclaimer","FSFUL","FSFULLR","FSFULLRWD","FTL","Fair","Ferguson-Twofish","Frameworx-1.0","FreeBSD-DOC","FreeImage","Furuseth","GCR-docs","GD","GFDL-1.1-invariants-only","GFDL-1.1-invariants-or-later","GFDL-1.1-no-invariants-only","GFDL-1.1-no-invariants-or-later","GFDL-1.1-only","GFDL-1.1-or-later","GFDL-1.2-invariants-only","GFDL-1.2-invariants-or-later","GFDL-1.2-no-invariants-only","GFDL-1.2-no-invariants-or-later","GFDL-1.2-only","GFDL-1.2-or-later","GFDL-1.3-invariants-only","GFDL-1.3-invariants-or-later","GFDL-1.3-no-invariants-only","GFDL-1.3-no-invariants-or-later","GFDL-1.3-only","GFDL-1.3-or-later","GL2PS","GLWTPL","GPL-1.0-only","GPL-1.0-or-later","GPL-2.0-only","GPL-2.0-or-later","GPL-3.0-only","GPL-3.0-or-later","Giftware","Glide","Glulxe","Graphics-Gems","Gutmann","HIDAPI","HP-1986","HP-1989","HPND","HPND-DEC","HPND-Fenneberg-Livingston","HPND-INRIA-IMAG","HPND-Intel","HPND-Kevlin-Henney","HPND-MIT-disclaimer","HPND-Markus-Kuhn","HPND-Netrek","HPND-Pbmplus","HPND-UC","HPND-UC-export-US","HPND-doc","HPND-doc-sell","HPND-export-US","HPND-export-US-acknowledgement","HPND-export-US-modify","HPND-export2-US","HPND-merchantability-variant","HPND-sell-MIT-disclaimer-xserver","HPND-sell-regexpr","HPND-sell-variant","HPND-sell-variant-MIT-disclaimer","HPND-sell-variant-MIT-disclaimer-rev","HTMLTIDY","HaskellReport","Hippocratic-2.1","IBM-pibs","ICU","IEC-Code-Components-EULA","IJG","IJG-short","IPA","IPL-1.0","ISC","ISC-Veillard","ImageMagick","Imlib2","Info-ZIP","Inner-Net-2.0","Intel","Intel-ACPI","Interbase-1.0","JPL-image","JPNIC","JSON","Jam","JasPer-2.0","Kastrup","Kazlib","Knuth-CTAN","LAL-1.2","LAL-1.3","LGPL-2.0-only","LGPL-2.0-or-later","LGPL-2.1-only","LGPL-2.1-or-later","LGPL-3.0-only","LGPL-3.0-or-later","LGPLLR","LOOP","LPD-document","LPL-1.0","LPL-1.02","LPPL-1.0","LPPL-1.1","LPPL-1.2","LPPL-1.3a","LPPL-1.3c","LZMA-SDK-9.11-to-9.20","LZMA-SDK-9.22","Latex2e","Latex2e-translated-notice","Leptonica","LiLiQ-P-1.1","LiLiQ-R-1.1","LiLiQ-Rplus-1.1","Libpng","Linux-OpenIB","Linux-man-pages-1-para","Linux-man-pages-copyleft","Linux-man-pages-copyleft-2-para","Linux-man-pages-copyleft-var","Lucida-Bitmap-Fonts","MIT","MIT-0","MIT-CMU","MIT-Festival","MIT-Khronos-old","MIT-Modern-Variant","MIT-Wu","MIT-advertising","MIT-enna","MIT-feh","MIT-open-group","MIT-testregex","MITNFA","MMIXware","MPEG-SSG","MPL-1.0","MPL-1.1","MPL-2.0","MPL-2.0-no-copyleft-exception","MS-LPL","MS-PL","MS-RL","MTLL","Mackerras-3-Clause","Mackerras-3-Clause-acknowledgment","MakeIndex","Martin-Birgmeier","McPhee-slideshow","Minpack","MirOS","Motosoto","MulanPSL-1.0","MulanPSL-2.0","Multics","Mup","NAIST-2003","NASA-1.3","NBPL-1.0","NCBI-PD","NCGL-UK-2.0","NCL","NCSA","NGPL","NICTA-1.0","NIST-PD","NIST-PD-fallback","NIST-Software","NLOD-1.0","NLOD-2.0","NLPL","NOSL","NPL-1.0","NPL-1.1","NPOSL-3.0","NRL","NTP","NTP-0","Naumen","NetCDF","Newsletr","Nokia","Noweb","O-UDA-1.0","OAR","OCCT-PL","OCLC-2.0","ODC-By-1.0","ODbL-1.0","OFFIS","OFL-1.0","OFL-1.0-RFN","OFL-1.0-no-RFN","OFL-1.1","OFL-1.1-RFN","OFL-1.1-no-RFN","OGC-1.0","OGDL-Taiwan-1.0","OGL-Canada-2.0","OGL-UK-1.0","OGL-UK-2.0","OGL-UK-3.0","OGTSL","OLDAP-1.1","OLDAP-1.2","OLDAP-1.3","OLDAP-1.4","OLDAP-2.0","OLDAP-2.0.1","OLDAP-2.1","OLDAP-2.2","OLDAP-2.2.1","OLDAP-2.2.2","OLDAP-2.3","OLDAP-2.4","OLDAP-2.5","OLDAP-2.6","OLDAP-2.7","OLDAP-2.8","OLFL-1.3","OML","OPL-1.0","OPL-UK-3.0","OPUBL-1.0","OSET-PL-2.1","OSL-1.0","OSL-1.1","OSL-2.0","OSL-2.1","OSL-3.0","OpenPBS-2.3","OpenSSL","OpenSSL-standalone","OpenVision","PADL","PDDL-1.0","PHP-3.0","PHP-3.01","PPL","PSF-2.0","Parity-6.0.0","Parity-7.0.0","Pixar","Plexus","PolyForm-Noncommercial-1.0.0","PolyForm-Small-Business-1.0.0","PostgreSQL","Python-2.0","Python-2.0.1","QPL-1.0","QPL-1.0-INRIA-2004","Qhull","RHeCos-1.1","RPL-1.1","RPL-1.5","RPSL-1.0","RSA-MD","RSCPL","Rdisc","Ruby","Ruby-pty","SAX-PD","SAX-PD-2.0","SCEA","SGI-B-1.0","SGI-B-1.1","SGI-B-2.0","SGI-OpenGL","SGP4","SHL-0.5","SHL-0.51","SISSL","SISSL-1.2","SL","SMLNJ","SMPPL","SNIA","SPL-1.0","SSH-OpenSSH","SSH-short","SSLeay-standalone","SSPL-1.0","SWL","Saxpath","SchemeReport","Sendmail","Sendmail-8.23","SimPL-2.0","Sleepycat","Soundex","Spencer-86","Spencer-94","Spencer-99","SugarCRM-1.1.3","Sun-PPP","Sun-PPP-2000","SunPro","Symlinks","TAPR-OHL-1.0","TCL","TCP-wrappers","TGPPL-1.0","TMate","TORQUE-1.1","TOSL","TPDL","TPL-1.0","TTWL","TTYP0","TU-Berlin-1.0","TU-Berlin-2.0","TermReadKey","UCAR","UCL-1.0","UMich-Merit","UPL-1.0","URT-RLE","Ubuntu-font-1.0","Unicode-3.0","Unicode-DFS-2015","Unicode-DFS-2016","Unicode-TOU","UnixCrypt","Unlicense","VOSTROM","VSL-1.0","Vim","W3C","W3C-19980720","W3C-20150513","WTFPL","Watcom-1.0","Widget-Workshop","Wsuipa","X11","X11-distribute-modifications-variant","X11-swapped","XFree86-1.1","XSkat","Xdebug-1.03","Xerox","Xfig","Xnet","YPL-1.0","YPL-1.1","ZPL-1.1","ZPL-2.0","ZPL-2.1","Zed","Zeeff","Zend-2.0","Zimbra-1.3","Zimbra-1.4","Zlib","any-OSI","bcrypt-Solar-Designer","blessing","bzip2-1.0.6","check-cvs","checkmk","copyleft-next-0.3.0","copyleft-next-0.3.1","curl","cve-tou","diffmark","dtoa","dvipdfm","eGenix","etalab-2.0","fwlw","gSOAP-1.3b","gnuplot","gtkbook","hdparm","iMatix","libpng-2.0","libselinux-1.0","libtiff","libutil-David-Nugent","lsof","magaz","mailprio","metamail","mpi-permissive","mpich2","mplus","pkgconf","pnmstitch","psfrag","psutils","python-ldap","radvd","snprintf","softSurfer","ssh-keyscan","swrule","threeparttable","ulem","w3m","xinetd","xkeyboard-config-Zinoviev","xlock","xpp","xzoom","zlib-acknowledgement"]'); /***/ }), @@ -51065,6 +52013,34 @@ module.exports = JSON.parse('[["AFL-1.1","AFL-1.2","AFL-2.0","AFL-2.1","AFL-3.0" /******/ } /******/ /************************************************************************/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __nccwpck_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__nccwpck_require__.o(definition, key) && !__nccwpck_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __nccwpck_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __nccwpck_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ /******/ /* webpack/runtime/node module decorator */ /******/ (() => { /******/ __nccwpck_require__.nmd = (module) => { diff --git a/actions/check-licenses/dist/licenses.txt b/actions/check-licenses/dist/licenses.txt index 06a4246b9e..f388b0e9f2 100644 --- a/actions/check-licenses/dist/licenses.txt +++ b/actions/check-licenses/dist/licenses.txt @@ -10,6 +10,18 @@ The above copyright notice and this permission notice shall be included in all c THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +@actions/exec +MIT +The MIT License (MIT) + +Copyright 2019 GitHub + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + @actions/http-client MIT Actions Http Client for Node.js @@ -35,6 +47,18 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +@actions/io +MIT +The MIT License (MIT) + +Copyright 2019 GitHub + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + @fastify/busboy MIT Copyright Brian White. All rights reserved. @@ -576,7 +600,7 @@ ms MIT The MIT License (MIT) -Copyright (c) 2016 Zeit, Inc. +Copyright (c) 2020 Vercel, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -1148,19 +1172,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -uuid -MIT -The MIT License (MIT) - -Copyright (c) 2010-2020 Robert Kieffer and other contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - validate-npm-package-license Apache-2.0 diff --git a/actions/check-licenses/package.json b/actions/check-licenses/package.json index 55b7783bbf..9411c00088 100644 --- a/actions/check-licenses/package.json +++ b/actions/check-licenses/package.json @@ -27,6 +27,7 @@ "license-checker-rseidelsohn": "^4.3.0" }, "devDependencies": { - "@vercel/ncc": "^0.36.1" + "@vercel/ncc": "^0.36.1", + "typescript": "^4" } } diff --git a/actions/check-licenses/src/licenses.ts b/actions/check-licenses/src/licenses.ts index a0ed1e34ec..66da83baff 100644 --- a/actions/check-licenses/src/licenses.ts +++ b/actions/check-licenses/src/licenses.ts @@ -19,6 +19,7 @@ export const ALLOWED_LICENSES = [ // If you download the package to your filesystem, you'll see that it's the Apache 2.0 license in fact 'Custom: https://github.com/paypal/Checkout-NodeJS-SDK/blob/master/LICENSE', 'Custom: VSFEL', + 'Custom: LICENSE', 'CC-BY-4.0', 'ISC', 'MIT', diff --git a/actions/check-licenses/yarn.lock b/actions/check-licenses/yarn.lock new file mode 100644 index 0000000000..ff06b238e8 --- /dev/null +++ b/actions/check-licenses/yarn.lock @@ -0,0 +1,696 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@actions/core@^1.10.0": + version "1.11.1" + resolved "https://registrynpm.storefrontcloud.io/@actions/core/-/core-1.11.1.tgz#ae683aac5112438021588030efb53b1adb86f172" + integrity sha512-hXJCSrkwfA46Vd9Z3q4cpEpHB1rL5NG04+/rbqW9d3+CSvtB1tYe8UTpAlixa1vj0m/ULglfEK2UKxMGxCxv5A== + dependencies: + "@actions/exec" "^1.1.1" + "@actions/http-client" "^2.0.1" + +"@actions/exec@^1.1.1": + version "1.1.1" + resolved "https://registrynpm.storefrontcloud.io/@actions/exec/-/exec-1.1.1.tgz#2e43f28c54022537172819a7cf886c844221a611" + integrity sha512-+sCcHHbVdk93a0XT19ECtO/gIXoxvdsgQLzb2fE2/5sIZmWQuluYyjPQtrtTHdU1YzTZ7bAPN4sITq2xi1679w== + dependencies: + "@actions/io" "^1.0.1" + +"@actions/github@^5.1.1": + version "5.1.1" + resolved "https://registrynpm.storefrontcloud.io/@actions/github/-/github-5.1.1.tgz#40b9b9e1323a5efcf4ff7dadd33d8ea51651bbcb" + integrity sha512-Nk59rMDoJaV+mHCOJPXuvB1zIbomlKS0dmSIqPGxd0enAXBnOfn4VWF+CGtRCwXZG9Epa54tZA7VIRlJDS8A6g== + dependencies: + "@actions/http-client" "^2.0.1" + "@octokit/core" "^3.6.0" + "@octokit/plugin-paginate-rest" "^2.17.0" + "@octokit/plugin-rest-endpoint-methods" "^5.13.0" + +"@actions/http-client@^2.0.1": + version "2.2.3" + resolved "https://registrynpm.storefrontcloud.io/@actions/http-client/-/http-client-2.2.3.tgz#31fc0b25c0e665754ed39a9f19a8611fc6dab674" + integrity sha512-mx8hyJi/hjFvbPokCg4uRd4ZX78t+YyRPtnKWwIl+RzNaVuFpQHfmlGVfsKEJN8LwTCvL+DfVgAM04XaHkm6bA== + dependencies: + tunnel "^0.0.6" + undici "^5.25.4" + +"@actions/io@^1.0.1": + version "1.1.3" + resolved "https://registrynpm.storefrontcloud.io/@actions/io/-/io-1.1.3.tgz#4cdb6254da7962b07473ff5c335f3da485d94d71" + integrity sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q== + +"@fastify/busboy@^2.0.0": + version "2.1.1" + resolved "https://registrynpm.storefrontcloud.io/@fastify/busboy/-/busboy-2.1.1.tgz#b9da6a878a371829a0502c9b6c1c143ef6663f4d" + integrity sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA== + +"@isaacs/cliui@^8.0.2": + version "8.0.2" + resolved "https://registrynpm.storefrontcloud.io/@isaacs/cliui/-/cliui-8.0.2.tgz#b37667b7bc181c168782259bab42474fbf52b550" + integrity sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA== + dependencies: + string-width "^5.1.2" + string-width-cjs "npm:string-width@^4.2.0" + strip-ansi "^7.0.1" + strip-ansi-cjs "npm:strip-ansi@^6.0.1" + wrap-ansi "^8.1.0" + wrap-ansi-cjs "npm:wrap-ansi@^7.0.0" + +"@npmcli/fs@^3.1.0": + version "3.1.1" + resolved "https://registrynpm.storefrontcloud.io/@npmcli/fs/-/fs-3.1.1.tgz#59cdaa5adca95d135fc00f2bb53f5771575ce726" + integrity sha512-q9CRWjpHCMIh5sVyefoD1cA7PkvILqCZsnSOEUUivORLjxCO/Irmue2DprETiNgEqktDBZaM1Bi+jrarx1XdCg== + dependencies: + semver "^7.3.5" + +"@octokit/auth-token@^2.4.4": + version "2.5.0" + resolved "https://registrynpm.storefrontcloud.io/@octokit/auth-token/-/auth-token-2.5.0.tgz#27c37ea26c205f28443402477ffd261311f21e36" + integrity sha512-r5FVUJCOLl19AxiuZD2VRZ/ORjp/4IN98Of6YJoJOkY75CIBuYfmiNHGrDwXr+aLGG55igl9QrxX3hbiXlLb+g== + dependencies: + "@octokit/types" "^6.0.3" + +"@octokit/core@^3.6.0": + version "3.6.0" + resolved "https://registrynpm.storefrontcloud.io/@octokit/core/-/core-3.6.0.tgz#3376cb9f3008d9b3d110370d90e0a1fcd5fe6085" + integrity sha512-7RKRKuA4xTjMhY+eG3jthb3hlZCsOwg3rztWh75Xc+ShDWOfDDATWbeZpAHBNRpm4Tv9WgBMOy1zEJYXG6NJ7Q== + dependencies: + "@octokit/auth-token" "^2.4.4" + "@octokit/graphql" "^4.5.8" + "@octokit/request" "^5.6.3" + "@octokit/request-error" "^2.0.5" + "@octokit/types" "^6.0.3" + before-after-hook "^2.2.0" + universal-user-agent "^6.0.0" + +"@octokit/endpoint@^6.0.1": + version "6.0.12" + resolved "https://registrynpm.storefrontcloud.io/@octokit/endpoint/-/endpoint-6.0.12.tgz#3b4d47a4b0e79b1027fb8d75d4221928b2d05658" + integrity sha512-lF3puPwkQWGfkMClXb4k/eUT/nZKQfxinRWJrdZaJO85Dqwo/G0yOC434Jr2ojwafWJMYqFGFa5ms4jJUgujdA== + dependencies: + "@octokit/types" "^6.0.3" + is-plain-object "^5.0.0" + universal-user-agent "^6.0.0" + +"@octokit/graphql@^4.5.8": + version "4.8.0" + resolved "https://registrynpm.storefrontcloud.io/@octokit/graphql/-/graphql-4.8.0.tgz#664d9b11c0e12112cbf78e10f49a05959aa22cc3" + integrity sha512-0gv+qLSBLKF0z8TKaSKTsS39scVKF9dbMxJpj3U0vC7wjNWFuIpL/z76Qe2fiuCbDRcJSavkXsVtMS6/dtQQsg== + dependencies: + "@octokit/request" "^5.6.0" + "@octokit/types" "^6.0.3" + universal-user-agent "^6.0.0" + +"@octokit/openapi-types@^12.11.0": + version "12.11.0" + resolved "https://registrynpm.storefrontcloud.io/@octokit/openapi-types/-/openapi-types-12.11.0.tgz#da5638d64f2b919bca89ce6602d059f1b52d3ef0" + integrity sha512-VsXyi8peyRq9PqIz/tpqiL2w3w80OgVMwBHltTml3LmVvXiphgeqmY9mvBw9Wu7e0QWk/fqD37ux8yP5uVekyQ== + +"@octokit/plugin-paginate-rest@^2.17.0": + version "2.21.3" + resolved "https://registrynpm.storefrontcloud.io/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.21.3.tgz#7f12532797775640dbb8224da577da7dc210c87e" + integrity sha512-aCZTEf0y2h3OLbrgKkrfFdjRL6eSOo8komneVQJnYecAxIej7Bafor2xhuDJOIFau4pk0i/P28/XgtbyPF0ZHw== + dependencies: + "@octokit/types" "^6.40.0" + +"@octokit/plugin-rest-endpoint-methods@^5.13.0": + version "5.16.2" + resolved "https://registrynpm.storefrontcloud.io/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.16.2.tgz#7ee8bf586df97dd6868cf68f641354e908c25342" + integrity sha512-8QFz29Fg5jDuTPXVtey05BLm7OB+M8fnvE64RNegzX7U+5NUXcOcnpTIK0YfSHBg8gYd0oxIq3IZTe9SfPZiRw== + dependencies: + "@octokit/types" "^6.39.0" + deprecation "^2.3.1" + +"@octokit/request-error@^2.0.5", "@octokit/request-error@^2.1.0": + version "2.1.0" + resolved "https://registrynpm.storefrontcloud.io/@octokit/request-error/-/request-error-2.1.0.tgz#9e150357831bfc788d13a4fd4b1913d60c74d677" + integrity sha512-1VIvgXxs9WHSjicsRwq8PlR2LR2x6DwsJAaFgzdi0JfJoGSO8mYI/cHJQ+9FbN21aa+DrgNLnwObmyeSC8Rmpg== + dependencies: + "@octokit/types" "^6.0.3" + deprecation "^2.0.0" + once "^1.4.0" + +"@octokit/request@^5.6.0", "@octokit/request@^5.6.3": + version "5.6.3" + resolved "https://registrynpm.storefrontcloud.io/@octokit/request/-/request-5.6.3.tgz#19a022515a5bba965ac06c9d1334514eb50c48b0" + integrity sha512-bFJl0I1KVc9jYTe9tdGGpAMPy32dLBXXo1dS/YwSCTL/2nd9XeHsY616RE3HPXDVk+a+dBuzyz5YdlXwcDTr2A== + dependencies: + "@octokit/endpoint" "^6.0.1" + "@octokit/request-error" "^2.1.0" + "@octokit/types" "^6.16.1" + is-plain-object "^5.0.0" + node-fetch "^2.6.7" + universal-user-agent "^6.0.0" + +"@octokit/types@^6.0.3", "@octokit/types@^6.16.1", "@octokit/types@^6.39.0", "@octokit/types@^6.40.0": + version "6.41.0" + resolved "https://registrynpm.storefrontcloud.io/@octokit/types/-/types-6.41.0.tgz#e58ef78d78596d2fb7df9c6259802464b5f84a04" + integrity sha512-eJ2jbzjdijiL3B4PrSQaSjuF2sPEQPVCPzBvTHJD9Nz+9dw2SGH4K4xeQJ77YfTq5bRQ+bD8wT11JbeDPmxmGg== + dependencies: + "@octokit/openapi-types" "^12.11.0" + +"@pkgjs/parseargs@^0.11.0": + version "0.11.0" + resolved "https://registrynpm.storefrontcloud.io/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" + integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg== + +"@vercel/ncc@^0.36.1": + version "0.36.1" + resolved "https://registrynpm.storefrontcloud.io/@vercel/ncc/-/ncc-0.36.1.tgz#d4c01fdbbe909d128d1bf11c7f8b5431654c5b95" + integrity sha512-S4cL7Taa9yb5qbv+6wLgiKVZ03Qfkc4jGRuiUQMQ8HGBD5pcNRnHeYM33zBvJE4/zJGjJJ8GScB+WmTsn9mORw== + +abbrev@^2.0.0: + version "2.0.0" + resolved "https://registrynpm.storefrontcloud.io/abbrev/-/abbrev-2.0.0.tgz#cf59829b8b4f03f89dda2771cb7f3653828c89bf" + integrity sha512-6/mh1E2u2YgEsCHdY0Yx5oW+61gZU+1vXaoiHHrpKeuRNNgFvS+/jrwHiQhB5apAf5oB7UB7E19ol2R2LKH8hQ== + +ansi-regex@^5.0.1: + version "5.0.1" + resolved "https://registrynpm.storefrontcloud.io/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== + +ansi-regex@^6.0.1: + version "6.1.0" + resolved "https://registrynpm.storefrontcloud.io/ansi-regex/-/ansi-regex-6.1.0.tgz#95ec409c69619d6cb1b8b34f14b660ef28ebd654" + integrity sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA== + +ansi-styles@^4.0.0, ansi-styles@^4.1.0: + version "4.3.0" + resolved "https://registrynpm.storefrontcloud.io/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + +ansi-styles@^6.1.0: + version "6.2.1" + resolved "https://registrynpm.storefrontcloud.io/ansi-styles/-/ansi-styles-6.2.1.tgz#0e62320cf99c21afff3b3012192546aacbfb05c5" + integrity sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug== + +array-find-index@^1.0.2: + version "1.0.2" + resolved "https://registrynpm.storefrontcloud.io/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1" + integrity sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E= + +balanced-match@^1.0.0: + version "1.0.2" + resolved "https://registrynpm.storefrontcloud.io/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" + integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== + +before-after-hook@^2.2.0: + version "2.2.3" + resolved "https://registrynpm.storefrontcloud.io/before-after-hook/-/before-after-hook-2.2.3.tgz#c51e809c81a4e354084422b9b26bad88249c517c" + integrity sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ== + +brace-expansion@^2.0.1: + version "2.0.1" + resolved "https://registrynpm.storefrontcloud.io/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" + integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== + dependencies: + balanced-match "^1.0.0" + +chalk@4.1.2: + version "4.1.2" + resolved "https://registrynpm.storefrontcloud.io/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registrynpm.storefrontcloud.io/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + +color-name@~1.1.4: + version "1.1.4" + resolved "https://registrynpm.storefrontcloud.io/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +cross-spawn@^7.0.0: + version "7.0.6" + resolved "https://registrynpm.storefrontcloud.io/cross-spawn/-/cross-spawn-7.0.6.tgz#8a58fe78f00dcd70c370451759dfbfaf03e8ee9f" + integrity sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA== + dependencies: + path-key "^3.1.0" + shebang-command "^2.0.0" + which "^2.0.1" + +debug@^4.3.4: + version "4.4.0" + resolved "https://registrynpm.storefrontcloud.io/debug/-/debug-4.4.0.tgz#2b3f2aea2ffeb776477460267377dc8710faba8a" + integrity sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA== + dependencies: + ms "^2.1.3" + +deprecation@^2.0.0, deprecation@^2.3.1: + version "2.3.1" + resolved "https://registrynpm.storefrontcloud.io/deprecation/-/deprecation-2.3.1.tgz#6368cbdb40abf3373b525ac87e4a260c3a700919" + integrity sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ== + +eastasianwidth@^0.2.0: + version "0.2.0" + resolved "https://registrynpm.storefrontcloud.io/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb" + integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA== + +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registrynpm.storefrontcloud.io/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + +emoji-regex@^9.2.2: + version "9.2.2" + resolved "https://registrynpm.storefrontcloud.io/emoji-regex/-/emoji-regex-9.2.2.tgz#840c8803b0d8047f4ff0cf963176b32d4ef3ed72" + integrity sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg== + +foreground-child@^3.1.0: + version "3.3.0" + resolved "https://registrynpm.storefrontcloud.io/foreground-child/-/foreground-child-3.3.0.tgz#0ac8644c06e431439f8561db8ecf29a7b5519c77" + integrity sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg== + dependencies: + cross-spawn "^7.0.0" + signal-exit "^4.0.1" + +function-bind@^1.1.2: + version "1.1.2" + resolved "https://registrynpm.storefrontcloud.io/function-bind/-/function-bind-1.1.2.tgz#2c02d864d97f3ea6c8830c464cbd11ab6eab7a1c" + integrity sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA== + +glob@^10.2.2: + version "10.4.5" + resolved "https://registrynpm.storefrontcloud.io/glob/-/glob-10.4.5.tgz#f4d9f0b90ffdbab09c9d77f5f29b4262517b0956" + integrity sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg== + dependencies: + foreground-child "^3.1.0" + jackspeak "^3.1.2" + minimatch "^9.0.4" + minipass "^7.1.2" + package-json-from-dist "^1.0.0" + path-scurry "^1.11.1" + +graceful-fs@^4.1.2: + version "4.2.11" + resolved "https://registrynpm.storefrontcloud.io/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" + integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== + +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registrynpm.storefrontcloud.io/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + +hasown@^2.0.2: + version "2.0.2" + resolved "https://registrynpm.storefrontcloud.io/hasown/-/hasown-2.0.2.tgz#003eaf91be7adc372e84ec59dc37252cedb80003" + integrity sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ== + dependencies: + function-bind "^1.1.2" + +hosted-git-info@^6.0.0: + version "6.1.3" + resolved "https://registrynpm.storefrontcloud.io/hosted-git-info/-/hosted-git-info-6.1.3.tgz#2ee1a14a097a1236bddf8672c35b613c46c55946" + integrity sha512-HVJyzUrLIL1c0QmviVh5E8VGyUS7xCFPS6yydaVd1UegW+ibV/CohqTH9MkOLDp5o+rb82DMo77PTuc9F/8GKw== + dependencies: + lru-cache "^7.5.1" + +is-core-module@^2.8.1: + version "2.16.0" + resolved "https://registrynpm.storefrontcloud.io/is-core-module/-/is-core-module-2.16.0.tgz#6c01ffdd5e33c49c1d2abfa93334a85cb56bd81c" + integrity sha512-urTSINYfAYgcbLb0yDQ6egFm6h3Mo1DcF9EkyXSRjjzdHbsulg01qhwWuXdOoUBuTkbQ80KDboXa0vFJ+BDH+g== + dependencies: + hasown "^2.0.2" + +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registrynpm.storefrontcloud.io/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + +is-plain-object@^5.0.0: + version "5.0.0" + resolved "https://registrynpm.storefrontcloud.io/is-plain-object/-/is-plain-object-5.0.0.tgz#4427f50ab3429e9025ea7d52e9043a9ef4159344" + integrity sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q== + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registrynpm.storefrontcloud.io/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= + +jackspeak@^3.1.2: + version "3.4.3" + resolved "https://registrynpm.storefrontcloud.io/jackspeak/-/jackspeak-3.4.3.tgz#8833a9d89ab4acde6188942bd1c53b6390ed5a8a" + integrity sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw== + dependencies: + "@isaacs/cliui" "^8.0.2" + optionalDependencies: + "@pkgjs/parseargs" "^0.11.0" + +json-parse-even-better-errors@^3.0.0: + version "3.0.2" + resolved "https://registrynpm.storefrontcloud.io/json-parse-even-better-errors/-/json-parse-even-better-errors-3.0.2.tgz#b43d35e89c0f3be6b5fbbe9dc6c82467b30c28da" + integrity sha512-fi0NG4bPjCHunUJffmLd0gxssIgkNmArMvis4iNah6Owg1MCJjWhEcDLmsK6iGkJq3tHwbDkTlce70/tmXN4cQ== + +license-checker-rseidelsohn@^4.3.0: + version "4.4.2" + resolved "https://registrynpm.storefrontcloud.io/license-checker-rseidelsohn/-/license-checker-rseidelsohn-4.4.2.tgz#c8136cd5708ef68e5560445bd171cc4a5dc536df" + integrity sha512-Sf8WaJhd2vELvCne+frS9AXqnY/vv591s2/nZcJDwTnoNgltG4mAmoenffVb8L2YPRYbxARLyrHJBC38AVfpuA== + dependencies: + chalk "4.1.2" + debug "^4.3.4" + lodash.clonedeep "^4.5.0" + mkdirp "^1.0.4" + nopt "^7.2.0" + read-installed-packages "^2.0.1" + semver "^7.3.5" + spdx-correct "^3.1.1" + spdx-expression-parse "^3.0.1" + spdx-satisfies "^5.0.1" + treeify "^1.1.0" + +lodash.clonedeep@^4.5.0: + version "4.5.0" + resolved "https://registrynpm.storefrontcloud.io/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" + integrity sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8= + +lru-cache@^10.2.0: + version "10.4.3" + resolved "https://registrynpm.storefrontcloud.io/lru-cache/-/lru-cache-10.4.3.tgz#410fc8a17b70e598013df257c2446b7f3383f119" + integrity sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ== + +lru-cache@^7.5.1: + version "7.18.3" + resolved "https://registrynpm.storefrontcloud.io/lru-cache/-/lru-cache-7.18.3.tgz#f793896e0fd0e954a59dfdd82f0773808df6aa89" + integrity sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA== + +minimatch@^9.0.4: + version "9.0.5" + resolved "https://registrynpm.storefrontcloud.io/minimatch/-/minimatch-9.0.5.tgz#d74f9dd6b57d83d8e98cfb82133b03978bc929e5" + integrity sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow== + dependencies: + brace-expansion "^2.0.1" + +"minipass@^5.0.0 || ^6.0.2 || ^7.0.0", minipass@^7.1.2: + version "7.1.2" + resolved "https://registrynpm.storefrontcloud.io/minipass/-/minipass-7.1.2.tgz#93a9626ce5e5e66bd4db86849e7515e92340a707" + integrity sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw== + +mkdirp@^1.0.4: + version "1.0.4" + resolved "https://registrynpm.storefrontcloud.io/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" + integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== + +ms@^2.1.3: + version "2.1.3" + resolved "https://registrynpm.storefrontcloud.io/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" + integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== + +node-fetch@^2.6.7: + version "2.7.0" + resolved "https://registrynpm.storefrontcloud.io/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" + integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== + dependencies: + whatwg-url "^5.0.0" + +nopt@^7.2.0: + version "7.2.1" + resolved "https://registrynpm.storefrontcloud.io/nopt/-/nopt-7.2.1.tgz#1cac0eab9b8e97c9093338446eddd40b2c8ca1e7" + integrity sha512-taM24ViiimT/XntxbPyJQzCG+p4EKOpgD3mxFwW38mGjVUrfERQOeY4EDHjdnptttfHuHQXFx+lTP08Q+mLa/w== + dependencies: + abbrev "^2.0.0" + +normalize-package-data@^5.0.0: + version "5.0.0" + resolved "https://registrynpm.storefrontcloud.io/normalize-package-data/-/normalize-package-data-5.0.0.tgz#abcb8d7e724c40d88462b84982f7cbf6859b4588" + integrity sha512-h9iPVIfrVZ9wVYQnxFgtw1ugSvGEMOlyPWWtm8BMJhnwyEL/FLbYbTY3V3PpjI/BUK67n9PEWDu6eHzu1fB15Q== + dependencies: + hosted-git-info "^6.0.0" + is-core-module "^2.8.1" + semver "^7.3.5" + validate-npm-package-license "^3.0.4" + +npm-normalize-package-bin@^3.0.0: + version "3.0.1" + resolved "https://registrynpm.storefrontcloud.io/npm-normalize-package-bin/-/npm-normalize-package-bin-3.0.1.tgz#25447e32a9a7de1f51362c61a559233b89947832" + integrity sha512-dMxCf+zZ+3zeQZXKxmyuCKlIDPGuv8EF940xbkC4kQVDTtqoh6rJFO+JTKSA6/Rwi0getWmtuy4Itup0AMcaDQ== + +once@^1.4.0: + version "1.4.0" + resolved "https://registrynpm.storefrontcloud.io/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + dependencies: + wrappy "1" + +package-json-from-dist@^1.0.0: + version "1.0.1" + resolved "https://registrynpm.storefrontcloud.io/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz#4f1471a010827a86f94cfd9b0727e36d267de505" + integrity sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw== + +path-key@^3.1.0: + version "3.1.1" + resolved "https://registrynpm.storefrontcloud.io/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" + integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== + +path-scurry@^1.11.1: + version "1.11.1" + resolved "https://registrynpm.storefrontcloud.io/path-scurry/-/path-scurry-1.11.1.tgz#7960a668888594a0720b12a911d1a742ab9f11d2" + integrity sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA== + dependencies: + lru-cache "^10.2.0" + minipass "^5.0.0 || ^6.0.2 || ^7.0.0" + +read-installed-packages@^2.0.1: + version "2.0.1" + resolved "https://registrynpm.storefrontcloud.io/read-installed-packages/-/read-installed-packages-2.0.1.tgz#8ba63a9382a5158c37a288c2f21268d6eb9c85eb" + integrity sha512-t+fJOFOYaZIjBpTVxiV8Mkt7yQyy4E6MSrrnt5FmPd4enYvpU/9DYGirDmN1XQwkfeuWIhM/iu0t2rm6iSr0CA== + dependencies: + "@npmcli/fs" "^3.1.0" + debug "^4.3.4" + read-package-json "^6.0.0" + semver "2 || 3 || 4 || 5 || 6 || 7" + slide "~1.1.3" + optionalDependencies: + graceful-fs "^4.1.2" + +read-package-json@^6.0.0: + version "6.0.4" + resolved "https://registrynpm.storefrontcloud.io/read-package-json/-/read-package-json-6.0.4.tgz#90318824ec456c287437ea79595f4c2854708836" + integrity sha512-AEtWXYfopBj2z5N5PbkAOeNHRPUg5q+Nen7QLxV8M2zJq1ym6/lCz3fYNTCXe19puu2d06jfHhrP7v/S2PtMMw== + dependencies: + glob "^10.2.2" + json-parse-even-better-errors "^3.0.0" + normalize-package-data "^5.0.0" + npm-normalize-package-bin "^3.0.0" + +"semver@2 || 3 || 4 || 5 || 6 || 7", semver@^7.3.5: + version "7.6.3" + resolved "https://registrynpm.storefrontcloud.io/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143" + integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== + +shebang-command@^2.0.0: + version "2.0.0" + resolved "https://registrynpm.storefrontcloud.io/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" + integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== + dependencies: + shebang-regex "^3.0.0" + +shebang-regex@^3.0.0: + version "3.0.0" + resolved "https://registrynpm.storefrontcloud.io/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" + integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== + +signal-exit@^4.0.1: + version "4.1.0" + resolved "https://registrynpm.storefrontcloud.io/signal-exit/-/signal-exit-4.1.0.tgz#952188c1cbd546070e2dd20d0f41c0ae0530cb04" + integrity sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw== + +slide@~1.1.3: + version "1.1.6" + resolved "https://registrynpm.storefrontcloud.io/slide/-/slide-1.1.6.tgz#56eb027d65b4d2dce6cb2e2d32c4d4afc9e1d707" + integrity sha1-VusCfWW00tzmyy4tMsTUr8nh1wc= + +spdx-compare@^1.0.0: + version "1.0.0" + resolved "https://registrynpm.storefrontcloud.io/spdx-compare/-/spdx-compare-1.0.0.tgz#2c55f117362078d7409e6d7b08ce70a857cd3ed7" + integrity sha512-C1mDZOX0hnu0ep9dfmuoi03+eOdDoz2yvK79RxbcrVEG1NO1Ph35yW102DHWKN4pk80nwCgeMmSY5L25VE4D9A== + dependencies: + array-find-index "^1.0.2" + spdx-expression-parse "^3.0.0" + spdx-ranges "^2.0.0" + +spdx-correct@^3.0.0, spdx-correct@^3.1.1: + version "3.2.0" + resolved "https://registrynpm.storefrontcloud.io/spdx-correct/-/spdx-correct-3.2.0.tgz#4f5ab0668f0059e34f9c00dce331784a12de4e9c" + integrity sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA== + dependencies: + spdx-expression-parse "^3.0.0" + spdx-license-ids "^3.0.0" + +spdx-exceptions@^2.1.0: + version "2.5.0" + resolved "https://registrynpm.storefrontcloud.io/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz#5d607d27fc806f66d7b64a766650fa890f04ed66" + integrity sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w== + +spdx-expression-parse@^3.0.0, spdx-expression-parse@^3.0.1: + version "3.0.1" + resolved "https://registrynpm.storefrontcloud.io/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz#cf70f50482eefdc98e3ce0a6833e4a53ceeba679" + integrity sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q== + dependencies: + spdx-exceptions "^2.1.0" + spdx-license-ids "^3.0.0" + +spdx-license-ids@^3.0.0: + version "3.0.20" + resolved "https://registrynpm.storefrontcloud.io/spdx-license-ids/-/spdx-license-ids-3.0.20.tgz#e44ed19ed318dd1e5888f93325cee800f0f51b89" + integrity sha512-jg25NiDV/1fLtSgEgyvVyDunvaNHbuwF9lfNV17gSmPFAlYzdfNBlLtLzXTevwkPj7DhGbmN9VnmJIgLnhvaBw== + +spdx-ranges@^2.0.0: + version "2.1.1" + resolved "https://registrynpm.storefrontcloud.io/spdx-ranges/-/spdx-ranges-2.1.1.tgz#87573927ba51e92b3f4550ab60bfc83dd07bac20" + integrity sha512-mcdpQFV7UDAgLpXEE/jOMqvK4LBoO0uTQg0uvXUewmEFhpiZx5yJSZITHB8w1ZahKdhfZqP5GPEOKLyEq5p8XA== + +spdx-satisfies@^5.0.1: + version "5.0.1" + resolved "https://registrynpm.storefrontcloud.io/spdx-satisfies/-/spdx-satisfies-5.0.1.tgz#9feeb2524686c08e5f7933c16248d4fdf07ed6a6" + integrity sha512-Nwor6W6gzFp8XX4neaKQ7ChV4wmpSh2sSDemMFSzHxpTw460jxFYeOn+jq4ybnSSw/5sc3pjka9MQPouksQNpw== + dependencies: + spdx-compare "^1.0.0" + spdx-expression-parse "^3.0.0" + spdx-ranges "^2.0.0" + +"string-width-cjs@npm:string-width@^4.2.0": + version "4.2.3" + resolved "https://registrynpm.storefrontcloud.io/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +string-width@^4.1.0: + version "4.2.3" + resolved "https://registrynpm.storefrontcloud.io/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +string-width@^5.0.1, string-width@^5.1.2: + version "5.1.2" + resolved "https://registrynpm.storefrontcloud.io/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794" + integrity sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA== + dependencies: + eastasianwidth "^0.2.0" + emoji-regex "^9.2.2" + strip-ansi "^7.0.1" + +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": + version "6.0.1" + resolved "https://registrynpm.storefrontcloud.io/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registrynpm.storefrontcloud.io/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-ansi@^7.0.1: + version "7.1.0" + resolved "https://registrynpm.storefrontcloud.io/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" + integrity sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ== + dependencies: + ansi-regex "^6.0.1" + +supports-color@^7.1.0: + version "7.2.0" + resolved "https://registrynpm.storefrontcloud.io/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + +tr46@~0.0.3: + version "0.0.3" + resolved "https://registrynpm.storefrontcloud.io/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" + integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= + +treeify@^1.1.0: + version "1.1.0" + resolved "https://registrynpm.storefrontcloud.io/treeify/-/treeify-1.1.0.tgz#4e31c6a463accd0943879f30667c4fdaff411bb8" + integrity sha512-1m4RA7xVAJrSGrrXGs0L3YTwyvBs2S8PbRHaLZAkFw7JR8oIFwYtysxlBZhYIa7xSyiYJKZ3iGrrk55cGA3i9A== + +tunnel@^0.0.6: + version "0.0.6" + resolved "https://registrynpm.storefrontcloud.io/tunnel/-/tunnel-0.0.6.tgz#72f1314b34a5b192db012324df2cc587ca47f92c" + integrity sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg== + +typescript@^4: + version "4.9.5" + resolved "https://registrynpm.storefrontcloud.io/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" + integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== + +undici@^5.25.4: + version "5.28.4" + resolved "https://registrynpm.storefrontcloud.io/undici/-/undici-5.28.4.tgz#6b280408edb6a1a604a9b20340f45b422e373068" + integrity sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g== + dependencies: + "@fastify/busboy" "^2.0.0" + +universal-user-agent@^6.0.0: + version "6.0.1" + resolved "https://registrynpm.storefrontcloud.io/universal-user-agent/-/universal-user-agent-6.0.1.tgz#15f20f55da3c930c57bddbf1734c6654d5fd35aa" + integrity sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ== + +validate-npm-package-license@^3.0.4: + version "3.0.4" + resolved "https://registrynpm.storefrontcloud.io/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" + integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== + dependencies: + spdx-correct "^3.0.0" + spdx-expression-parse "^3.0.0" + +webidl-conversions@^3.0.0: + version "3.0.1" + resolved "https://registrynpm.storefrontcloud.io/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" + integrity sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE= + +whatwg-url@^5.0.0: + version "5.0.0" + resolved "https://registrynpm.storefrontcloud.io/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" + integrity sha1-lmRU6HZUYuN2RNNib2dCzotwll0= + dependencies: + tr46 "~0.0.3" + webidl-conversions "^3.0.0" + +which@^2.0.1: + version "2.0.2" + resolved "https://registrynpm.storefrontcloud.io/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + dependencies: + isexe "^2.0.0" + +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": + version "7.0.0" + resolved "https://registrynpm.storefrontcloud.io/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +wrap-ansi@^8.1.0: + version "8.1.0" + resolved "https://registrynpm.storefrontcloud.io/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" + integrity sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ== + dependencies: + ansi-styles "^6.1.0" + string-width "^5.0.1" + strip-ansi "^7.0.1" + +wrappy@1: + version "1.0.2" + resolved "https://registrynpm.storefrontcloud.io/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=