diff --git a/.github/actions/setup-swift/action.yml b/.github/actions/setup-swift/action.yml index accf49daf7..b1092f4b70 100644 --- a/.github/actions/setup-swift/action.yml +++ b/.github/actions/setup-swift/action.yml @@ -26,7 +26,7 @@ runs: VERSION="5.7.0" fi echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - - uses: swift-actions/setup-swift@da0e3e04b5e3e15dbc3861bd835ad9f0afe56296 # Please update the corresponding SHA in the CLI's CodeQL Action Integration Test. + - uses: swift-actions/setup-swift@65540b95f51493d65f5e59e97dcef9629ddf11bf # Please update the corresponding SHA in the CLI's CodeQL Action Integration Test. if: env.CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT == 'true' with: swift-version: "${{ steps.get_swift_version.outputs.version }}" diff --git a/.github/actions/update-bundle/index.ts b/.github/actions/update-bundle/index.ts index a8bd13e27a..a0f32312cd 100644 --- a/.github/actions/update-bundle/index.ts +++ b/.github/actions/update-bundle/index.ts @@ -13,57 +13,55 @@ interface Defaults { priorCliVersion: string; } -const CODEQL_BUNDLE_PREFIX = 'codeql-bundle-'; - function getCodeQLCliVersionForRelease(release): string { // We do not currently tag CodeQL bundles based on the CLI version they contain. // Instead, we use a marker file `cli-version-.txt` to record the CLI version. // This marker file is uploaded as a release asset for all new CodeQL bundles. const cliVersionsFromMarkerFiles = release.assets - .map((asset) => asset.name.match(/cli-version-(.*)\.txt/)?.[1]) - .filter((v) => v) - .map((v) => v as string); + .map((asset) => asset.name.match(/cli-version-(.*)\.txt/)?.[1]) + .filter((v) => v) + .map((v) => v as string); if (cliVersionsFromMarkerFiles.length > 1) { throw new Error( `Release ${release.tag_name} has multiple CLI version marker files.` - ); - } else if (cliVersionsFromMarkerFiles.length === 0) { - throw new Error( - `Failed to find the CodeQL CLI version for release ${release.tag_name}.` - ); - } - return cliVersionsFromMarkerFiles[0]; - } + ); + } else if (cliVersionsFromMarkerFiles.length === 0) { + throw new Error( + `Failed to find the CodeQL CLI version for release ${release.tag_name}.` + ); + } + return cliVersionsFromMarkerFiles[0]; +} - async function getBundleInfoFromRelease(release): Promise { - return { - bundleVersion: release.tag_name.substring(CODEQL_BUNDLE_PREFIX.length), - cliVersion: getCodeQLCliVersionForRelease(release) - }; - } +async function getBundleInfoFromRelease(release): Promise { + return { + bundleVersion: release.tag_name, + cliVersion: getCodeQLCliVersionForRelease(release) + }; +} - async function getNewDefaults(currentDefaults: Defaults): Promise { - const release = github.context.payload.release; - console.log('Updating default bundle as a result of the following release: ' + - `${JSON.stringify(release)}.`) +async function getNewDefaults(currentDefaults: Defaults): Promise { + const release = github.context.payload.release; + console.log('Updating default bundle as a result of the following release: ' + + `${JSON.stringify(release)}.`) - const bundleInfo = await getBundleInfoFromRelease(release); - return { - bundleVersion: bundleInfo.bundleVersion, - cliVersion: bundleInfo.cliVersion, - priorBundleVersion: currentDefaults.bundleVersion, - priorCliVersion: currentDefaults.cliVersion - }; - } + const bundleInfo = await getBundleInfoFromRelease(release); + return { + bundleVersion: bundleInfo.bundleVersion, + cliVersion: bundleInfo.cliVersion, + priorBundleVersion: currentDefaults.bundleVersion, + priorCliVersion: currentDefaults.cliVersion + }; +} - async function main() { - const previousDefaults: Defaults = JSON.parse(fs.readFileSync('../../../src/defaults.json', 'utf8')); - const newDefaults = await getNewDefaults(previousDefaults); - // Update the source file in the repository. Calling workflows should subsequently rebuild - // the Action to update `lib/defaults.json`. - fs.writeFileSync('../../../src/defaults.json', JSON.stringify(newDefaults, null, 2) + "\n"); - } +async function main() { + const previousDefaults: Defaults = JSON.parse(fs.readFileSync('../../../src/defaults.json', 'utf8')); + const newDefaults = await getNewDefaults(previousDefaults); + // Update the source file in the repository. Calling workflows should subsequently rebuild + // the Action to update `lib/defaults.json`. + fs.writeFileSync('../../../src/defaults.json', JSON.stringify(newDefaults, null, 2) + "\n"); +} - // Ideally, we'd await main() here, but that doesn't work well with `ts-node`. - // So instead we rely on the fact that Node won't exit until the event loop is empty. - main(); +// Ideally, we'd await main() here, but that doesn't work well with `ts-node`. +// So instead we rely on the fact that Node won't exit until the event loop is empty. +main(); diff --git a/.github/workflows/update-bundle.yml b/.github/workflows/update-bundle.yml index a94d11e934..1f11656b67 100644 --- a/.github/workflows/update-bundle.yml +++ b/.github/workflows/update-bundle.yml @@ -2,11 +2,20 @@ name: Update default CodeQL bundle on: release: - types: [prereleased] + # From https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release + # Note: The prereleased type will not trigger for pre-releases published + # from draft releases, but the published type will trigger. If you want a + # workflow to run when stable and pre-releases publish, subscribe to + # published instead of released and prereleased. + # + # From https://github.com/orgs/community/discussions/26281 + # As a work around, in published type workflow, you could add if condition + # to filter pre-release attribute. + types: [published] jobs: update-bundle: - if: startsWith(github.event.release.tag_name, 'codeql-bundle-') + if: github.event.release.prerelease && startsWith(github.event.release.tag_name, 'codeql-bundle-') runs-on: ubuntu-latest steps: - name: Dump environment diff --git a/CHANGELOG.md b/CHANGELOG.md index a45048fa16..ff361b24b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,12 @@ ## [UNRELEASED] - Bump the minimum CodeQL bundle version to 2.8.5. [#1618](https://github.com/github/codeql-action/pull/1618) +No user facing changes. + +## 2.2.12 - 13 Apr 2023 + - Include the value of the `GITHUB_RUN_ATTEMPT` environment variable in the telemetry sent to GitHub. [#1640](https://github.com/github/codeql-action/pull/1640) +- Improve the ease of debugging failed runs configured using [default setup](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning-for-a-repository#configuring-code-scanning-automatically). The CodeQL Action will now upload diagnostic information to Code Scanning from failed runs configured using default setup. You can view this diagnostic information on the [tool status page](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/about-the-tool-status-page). [#1619](https://github.com/github/codeql-action/pull/1619) ## 2.2.11 - 06 Apr 2023 diff --git a/lib/actions-util.js b/lib/actions-util.js index 06673b839d..0eb63e96bb 100644 --- a/lib/actions-util.js +++ b/lib/actions-util.js @@ -163,7 +163,7 @@ async function getAnalysisKey() { if (analysisKey !== undefined) { return analysisKey; } - const workflowPath = await (0, workflow_1.getWorkflowPath)(); + const workflowPath = await (0, workflow_1.getWorkflowRelativePath)(); const jobName = (0, util_1.getRequiredEnvParam)("GITHUB_JOB"); analysisKey = `${workflowPath}:${jobName}`; core.exportVariable(analysisKeyEnvVar, analysisKey); diff --git a/lib/actions-util.js.map b/lib/actions-util.js.map index 9a7fbfde72..42c00a58d3 100644 --- a/lib/actions-util.js.map +++ b/lib/actions-util.js.map @@ -1 +1 @@ -{"version":3,"file":"actions-util.js","sourceRoot":"","sources":["../src/actions-util.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,uCAAyB;AACzB,2CAA6B;AAE7B,oDAAsC;AACtC,yEAA2D;AAC3D,kEAAoD;AAGpD,kDAAoC;AAEpC,gEAAkD;AAClD,iCAUgB;AAChB,yCAA6C;AAE7C,8CAA8C;AAC9C,MAAM,GAAG,GAAG,OAAO,CAAC,iBAAiB,CAAqC,CAAC;AAE3E;;;;;GAKG;AACH,SAAgB,gBAAgB,CAAC,IAAY;IAC3C,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;AACjD,CAAC;AAFD,4CAEC;AAED;;;;;GAKG;AACI,MAAM,gBAAgB,GAAG,UAAU,IAAY;IACpD,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAClC,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AAC9C,CAAC,CAAC;AAHW,QAAA,gBAAgB,oBAG3B;AAEF,SAAgB,qBAAqB;IACnC,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IAChD,OAAO,KAAK,KAAK,SAAS,I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AAO,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;iBAC7C;aACF;QACH,CAAC,CAAC;QACF,YAAY,CAAC,aAAa,CAAC,CAAC;KAC7B;AACH,CAAC;AA7BD,wCA6BC;AAID,qHAAqH;AACrH,SAAgB,cAAc,CAAC,KAAyB;IACtD,QAAQ,KAAK,EAAE;QACb,KAAK,SAAS,CAAC;QACf,KAAK,MAAM,CAAC;QACZ,KAAK,QAAQ;YACX,OAAO,QAAQ,CAAC;QAClB,KAAK,OAAO,CAAC;QACb,KAAK,cAAc;YACjB,OAAO,cAAc,CAAC;QACxB,KAAK,OAAO;YACV,OAAO,OAAO,CAAC;QACjB;YACE,IAAI,CAAC,OAAO,CACV,oDAAoD,KAAK,2BAA2B,CACrF,CAAC;YACF,OAAO,QAAQ,CAAC;KACnB;AACH,CAAC;AAjBD,wCAiBC"} \ No newline at end of file +{"version":3,"file":"actions-util.js","sourceRoot":"","sources":["../src/actions-util.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,uCAAyB;AACzB,2CAA6B;AAE7B,oDAAsC;AACtC,yEAA2D;AAC3D,kEAAoD;AAGpD,kDAAoC;AAEpC,gEAAkD;AAClD,iCAUgB;AAChB,yCAAqD;AAErD,8CAA8C;AAC9C,MAAM,GAAG,GAAG,OAAO,CAAC,iBAAiB,CAAqC,CAAC;AAE3E;;;;;GAKG;AACH,SAAgB,gBAAgB,CAAC,IAAY;IAC3C,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;AACjD,CAAC;AAFD,4CAEC;AAED;;;;;GAKG;AACI,MAAM,gBAAgB,GAAG,UAAU,IAAY;IACpD,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAClC,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAA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,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,CAAC;oBACpD,IAAI,CAAC,QAAQ,EAAE,CAAC;iBACjB;qBAAM,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE;oBAC9B,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;iBAC7C;aACF;QACH,CAAC,CAAC;QACF,YAAY,CAAC,aAAa,CAAC,CAAC;KAC7B;AACH,CAAC;AA7BD,wCA6BC;AAID,qHAAqH;AACrH,SAAgB,cAAc,CAAC,KAAyB;IACtD,QAAQ,KAAK,EAAE;QACb,KAAK,SAAS,CAAC;QACf,KAAK,MAAM,CAAC;QACZ,KAAK,QAAQ;YACX,OAAO,QAAQ,CAAC;QAClB,KAAK,OAAO,CAAC;QACb,KAAK,cAAc;YACjB,OAAO,cAAc,CAAC;QACxB,KAAK,OAAO;YACV,OAAO,OAAO,CAAC;QACjB;YACE,IAAI,CAAC,OAAO,CACV,oDAAoD,KAAK,2BAA2B,CACrF,CAAC;YACF,OAAO,QAAQ,CAAC;KACnB;AACH,CAAC;AAjBD,wCAiBC"} \ No newline at end of file diff --git a/lib/init-action-post-helper.js b/lib/init-action-post-helper.js index 4fdf23fcdb..f07a9dab79 100644 --- a/lib/init-action-post-helper.js +++ b/lib/init-action-post-helper.js @@ -52,7 +52,7 @@ async function maybeUploadFailedSarif(config, repositoryNwo, features, logger) { if (!(await features.getValue(feature_flags_1.Feature.UploadFailedSarifEnabled, codeql))) { return { upload_failed_run_skipped_because: "Feature disabled" }; } - const workflow = await (0, workflow_1.getWorkflow)(); + const workflow = await (0, workflow_1.getWorkflow)(logger); const jobName = (0, util_1.getRequiredEnvParam)("GITHUB_JOB"); const matrix = (0, util_1.parseMatrixInput)(actionsUtil.getRequiredInput("matrix")); const shouldUpload = (0, workflow_1.getUploadInputOrThrow)(workflow, jobName, matrix); diff --git a/lib/init-action-post-helper.js.map b/lib/init-action-post-helper.js.map index f4e62f49c7..8e17dc5a81 100644 --- a/lib/init-action-post-helper.js.map +++ b/lib/init-action-post-helper.js.map @@ -1 +1 @@ -{"version":3,"file":"init-action-post-helper.js","sourceRoot":"","sources":["../src/init-action-post-helper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAsC;AAEtC,4DAA8C;AAC9C,qCAAqC;AACrC,iDAAmD;AACnD,mDAA6D;AAG7D,6DAAuF;AACvF,wDAA0C;AAC1C,iCAKgB;AAChB,yCAKoB;AAWpB,SAAS,mCAAmC,CAC1C,KAAc;IAEd,MAAM,YAAY,GAAG,IAAA,gBAAS,EAAC,KAAK,CAAC,CAAC;IACtC,OAAO;QACL,uBAAuB,EAAE,YAAY,CAAC,OAAO;QAC7C,6BAA6B,EAAE,YAAY,CAAC,KAAK;KAClD,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,KAAK,UAAU,sBAAsB,CACnC,MAAc,EACd,aAA4B,EAC5B,QAA2B,EAC3B,MAAc;IAEd,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE;QACrB,OAAO,EAAE,iCAAiC,EAAE,0BAA0B,EAAE,CAAC;KAC1E;IACD,MAAM,MAAM,GAAG,MAAM,IAAA,kBAAS,EAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACjD,IAAI,CAAC,CAAC,MAAM,QAAQ,CAAC,QAAQ,CAAC,uBAAO,CAAC,wBAAwB,EAAE,MAAM,CAAC,CAAC,EAAE;QACxE,OAAO,EAAE,iCAAiC,EAAE,kBAAkB,EAAE,CAAC;KAClE;IACD,MAAM,QAAQ,GAAG,MAAM,IAAA,sBAAW,GAAE,CAAC;IACrC,MAAM,OAAO,GAAG,IAAA,0BAAmB,EAAC,YAAY,CAAC,CAAC;IAClD,MAAM,MAAM,GAAG,IAAA,uBAAgB,EAAC,WAAW,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC;IACxE,MAA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K,CACb,4EAA4E;YAC1E,8BAA8B,uBAAuB,GAAG,CAC3D,CAAC;KACH;IAED,qDAAqD;IACrD,IAAI,MAAM,CAAC,SAAS,EAAE;QACpB,IAAI,CAAC,IAAI,CACP,mGAAmG,CACpG,CAAC;QACF,MAAM,iCAAiC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACxD,MAAM,uBAAuB,CAAC,MAAM,CAAC,CAAC;QAEtC,MAAM,cAAc,CAAC,MAAM,CAAC,CAAC;KAC9B;IAED,OAAO,uBAAuB,CAAC;AACjC,CAAC;AArDD,kBAqDC"} \ No newline at end of file +{"version":3,"file":"init-action-post-helper.js","sourceRoot":"","sources":["../src/init-action-post-helper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAsC;AAEtC,4DAA8C;AAC9C,qCAAqC;AACrC,iDAAmD;AACnD,mDAA6D;AAG7D,6DAAuF;AACvF,wDAA0C;AAC1C,iCAKgB;AAChB,yCAKoB;AAWpB,SAAS,mCAAmC,CAC1C,KAAc;IAEd,MAAM,YAAY,GAAG,IAAA,gBAAS,EAAC,KAAK,CAAC,CAAC;IACtC,OAAO;QACL,uBAAuB,EAAE,YAAY,CAAC,OAAO;QAC7C,6BAA6B,EAAE,YAAY,CAAC,KAAK;KAClD,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,KAAK,UAAU,sBAAsB,CACnC,MAAc,EACd,aAA4B,EAC5B,QAA2B,EAC3B,MAAc;IAEd,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE;QACrB,OAAO,EAAE,iCAAiC,EAAE,0BAA0B,EAAE,CAAC;KAC1E;IACD,MAAM,MAAM,GAAG,MAAM,IAAA,kBAAS,EAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACjD,IAAI,CAAC,CAAC,MAAM,QAAQ,CAAC,QAAQ,CAAC,uBAAO,CAAC,wBAAwB,EAAE,MAAM,CAAC,CAAC,EAAE;QACxE,OAAO,EAAE,iCAAiC,E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AC,iCAAiC,EAAE;QAC7D,MAAM,CAAC,KAAK,CACV,8EAA8E;YAC5E,GAAG,uBAAuB,CAAC,iCAAiC,GAAG,CAClE,CAAC;KACH;IACD,8FAA8F;IAC9F,iCAAiC;IACjC,IACE,OAAO,CAAC,GAAG,CAAC,0CAA0C,CAAC,KAAK,MAAM;QAClE,CAAC,uBAAuB,CAAC,qBAAqB,EAC9C;QACA,MAAM,IAAI,KAAK,CACb,4EAA4E;YAC1E,8BAA8B,uBAAuB,GAAG,CAC3D,CAAC;KACH;IAED,qDAAqD;IACrD,IAAI,MAAM,CAAC,SAAS,EAAE;QACpB,IAAI,CAAC,IAAI,CACP,mGAAmG,CACpG,CAAC;QACF,MAAM,iCAAiC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACxD,MAAM,uBAAuB,CAAC,MAAM,CAAC,CAAC;QAEtC,MAAM,cAAc,CAAC,MAAM,CAAC,CAAC;KAC9B;IAED,OAAO,uBAAuB,CAAC;AACjC,CAAC;AArDD,kBAqDC"} \ No newline at end of file diff --git a/lib/init-action.js b/lib/init-action.js index 43593a82ff..e34c99f6ee 100644 --- a/lib/init-action.js +++ b/lib/init-action.js @@ -115,7 +115,7 @@ async function run() { const registriesInput = (0, actions_util_1.getOptionalInput)("registries"); const features = new feature_flags_1.Features(gitHubVersion, repositoryNwo, (0, actions_util_1.getTemporaryDirectory)(), logger); try { - const workflowErrors = await (0, workflow_1.validateWorkflow)(); + const workflowErrors = await (0, workflow_1.validateWorkflow)(logger); if (!(await (0, actions_util_1.sendStatusReport)(await (0, actions_util_1.createStatusReportBase)("init", "starting", startedAt, workflowErrors)))) { return; } diff --git a/lib/init-action.js.map b/lib/init-action.js.map index 6013cba6d1..6833cde074 100644 --- a/lib/init-action.js.map +++ b/lib/init-action.js.map @@ -1 +1 @@ -{"version":3,"file":"init-action.js","sourceRoot":"","sources":["../src/init-action.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA6B;AAE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c,EAAE;QACvB,MAAM,KAAK,GAAG,IAAA,gBAAS,EAAC,cAAc,CAAC,CAAC;QACxC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC9B,MAAM,yBAAyB,CAC7B,SAAS,EACT,MAAM,EACN,uBAAuB,EACvB,sBAAsB,EACtB,WAAW,EACX,YAAY,EACZ,MAAM,EACN,KAAK,CACN,CAAC;QACF,OAAO;KACR;IACD,MAAM,yBAAyB,CAC7B,SAAS,EACT,MAAM,EACN,uBAAuB,EACvB,sBAAsB,EACtB,WAAW,EACX,YAAY,EACZ,MAAM,CACP,CAAC;AACJ,CAAC;AAED,SAAS,qBAAqB;IAC5B,0DAA0D;IAC1D,MAAM,WAAW,GAAG,IAAA,+BAAgB,EAAC,cAAc,CAAC,CAAC;IACrD,IAAI,WAAW,KAAK,SAAS;QAAE,OAAO,WAAW,KAAK,MAAM,CAAC;IAE7D,6FAA6F;IAC7F,IAAI,CAAC,IAAA,qBAAc,GAAE;QAAE,OAAO,KAAK,CAAC;IAEpC,oDAAoD;IACpD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,KAAK,UAAU,UAAU;IACvB,IAAI;QACF,MAAM,GAAG,EAAE,CAAC;KACb;IAAC,OAAO,KAAK,EAAE;QACd,IAAI,CAAC,SAAS,CAAC,uBAAuB,IAAA,gBAAS,EAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;KACnE;IACD,MAAM,IAAA,sBAAe,GAAE,CAAC;AAC1B,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"} \ No newline at end of file +{"version":3,"file":"init-action.js","sourceRoot":"","sources":["../src/init-action.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA6B;AAE7B,oDAAsC;AAEtC,iDASwB;AACxB,6CAAgD;AAGhD,mDAAoD;AACpD,iCAMgB;AAChB,2CAAuC;AACvC,uCAAqD;AACrD,6CAAkD;AAClD,iDAAmD;AACnD,iC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AAC;QAC9B,MAAM,yBAAyB,CAC7B,SAAS,EACT,MAAM,EACN,uBAAuB,EACvB,sBAAsB,EACtB,WAAW,EACX,YAAY,EACZ,MAAM,EACN,KAAK,CACN,CAAC;QACF,OAAO;KACR;IACD,MAAM,yBAAyB,CAC7B,SAAS,EACT,MAAM,EACN,uBAAuB,EACvB,sBAAsB,EACtB,WAAW,EACX,YAAY,EACZ,MAAM,CACP,CAAC;AACJ,CAAC;AAED,SAAS,qBAAqB;IAC5B,0DAA0D;IAC1D,MAAM,WAAW,GAAG,IAAA,+BAAgB,EAAC,cAAc,CAAC,CAAC;IACrD,IAAI,WAAW,KAAK,SAAS;QAAE,OAAO,WAAW,KAAK,MAAM,CAAC;IAE7D,6FAA6F;IAC7F,IAAI,CAAC,IAAA,qBAAc,GAAE;QAAE,OAAO,KAAK,CAAC;IAEpC,oDAAoD;IACpD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,KAAK,UAAU,UAAU;IACvB,IAAI;QACF,MAAM,GAAG,EAAE,CAAC;KACb;IAAC,OAAO,KAAK,EAAE;QACd,IAAI,CAAC,SAAS,CAAC,uBAAuB,IAAA,gBAAS,EAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;KACnE;IACD,MAAM,IAAA,sBAAe,GAAE,CAAC;AAC1B,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"} \ No newline at end of file diff --git a/lib/workflow.js b/lib/workflow.js index 567e75dafe..cf5202fdc6 100644 --- a/lib/workflow.js +++ b/lib/workflow.js @@ -22,10 +22,14 @@ var __importStar = (this && this.__importStar) || function (mod) { __setModuleDefault(result, mod); return result; }; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; Object.defineProperty(exports, "__esModule", { value: true }); -exports.getCheckoutPathInputOrThrow = exports.getUploadInputOrThrow = exports.getCategoryInputOrThrow = exports.getWorkflowRunID = exports.getWorkflowPath = exports.getWorkflow = exports.formatWorkflowCause = exports.formatWorkflowErrors = exports.validateWorkflow = exports.getWorkflowErrors = exports.WorkflowErrors = exports.patternIsSuperset = void 0; +exports.getCheckoutPathInputOrThrow = exports.getUploadInputOrThrow = exports.getCategoryInputOrThrow = exports.getWorkflowRunID = exports.getWorkflowRelativePath = exports.getWorkflow = exports.formatWorkflowCause = exports.formatWorkflowErrors = exports.validateWorkflow = exports.getWorkflowErrors = exports.WorkflowErrors = exports.patternIsSuperset = void 0; const fs = __importStar(require("fs")); const path = __importStar(require("path")); +const zlib_1 = __importDefault(require("zlib")); const core = __importStar(require("@actions/core")); const yaml = __importStar(require("js-yaml")); const api = __importStar(require("./api-client")); @@ -157,10 +161,10 @@ function getWorkflowErrors(doc) { return errors; } exports.getWorkflowErrors = getWorkflowErrors; -async function validateWorkflow() { +async function validateWorkflow(logger) { let workflow; try { - workflow = await getWorkflow(); + workflow = await getWorkflow(logger); } catch (e) { return `error: getWorkflow() failed: ${String(e)}`; @@ -198,25 +202,37 @@ function formatWorkflowCause(errors) { return errors.map((e) => e.code).join(","); } exports.formatWorkflowCause = formatWorkflowCause; -async function getWorkflow() { - const relativePath = await getWorkflowPath(); - const absolutePath = path.join((0, util_1.getRequiredEnvParam)("GITHUB_WORKSPACE"), relativePath); - try { - return yaml.load(fs.readFileSync(absolutePath, "utf-8")); - } - catch (e) { - if (e instanceof Error && e["code"] === "ENOENT") { - throw new Error(`Unable to load code scanning workflow from ${absolutePath}. This can happen if the currently ` + - "running workflow checks out a branch that doesn't contain the corresponding workflow file."); - } - throw e; +async function getWorkflow(logger) { + // In default setup, the currently executing workflow is not checked into the repository. + // Instead, a gzipped then base64 encoded version of the workflow file is provided via the + // `CODE_SCANNING_WORKFLOW_FILE` environment variable. + const maybeWorkflow = process.env["CODE_SCANNING_WORKFLOW_FILE"]; + if (maybeWorkflow) { + logger.debug("Using the workflow specified by the CODE_SCANNING_WORKFLOW_FILE environment variable."); + return yaml.load(zlib_1.default.gunzipSync(Buffer.from(maybeWorkflow, "base64")).toString()); } + const workflowPath = await getWorkflowAbsolutePath(logger); + return yaml.load(fs.readFileSync(workflowPath, "utf-8")); } exports.getWorkflow = getWorkflow; /** - * Get the path of the currently executing workflow. + * Get the absolute path of the currently executing workflow. + */ +async function getWorkflowAbsolutePath(logger) { + const relativePath = await getWorkflowRelativePath(); + const absolutePath = path.join((0, util_1.getRequiredEnvParam)("GITHUB_WORKSPACE"), relativePath); + if (fs.existsSync(absolutePath)) { + logger.debug(`Derived the following absolute path for the currently executing workflow: ${absolutePath}.`); + return absolutePath; + } + throw new Error(`Expected to find a code scanning workflow file at ${absolutePath}, but no such file existed. ` + + "This can happen if the currently running workflow checks out a branch that doesn't contain " + + "the corresponding workflow file."); +} +/** + * Get the path of the currently executing workflow relative to the repository root. */ -async function getWorkflowPath() { +async function getWorkflowRelativePath() { const repo_nwo = (0, util_1.getRequiredEnvParam)("GITHUB_REPOSITORY").split("/"); const owner = repo_nwo[0]; const repo = repo_nwo[1]; @@ -231,7 +247,7 @@ async function getWorkflowPath() { const workflowResponse = await apiClient.request(`GET ${workflowUrl}`); return workflowResponse.data.path; } -exports.getWorkflowPath = getWorkflowPath; +exports.getWorkflowRelativePath = getWorkflowRelativePath; /** * Get the workflow run ID. */ diff --git a/lib/workflow.js.map b/lib/workflow.js.map index f957ddd1dc..107b6b12c1 100644 --- a/lib/workflow.js.map +++ b/lib/workflow.js.map @@ -1 +1 @@ -{"version":3,"file":"workflow.js","sourceRoot":"","sources":["../src/workflow.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAE7B,oDAAsC;AACtC,8CAAgC;AAEhC,kDAAoC;AACpC,iCAA6C;AAqC7C,SAAS,QAAQ,CAAC,CAAU;IAC1B,OAAO,CAAC,KAAK,IAAI,IAAI,OAAO,CAAC,KAAK,QAAQ,CAAC;AAC7C,CAAC;AAED,MAAM,YAAY,GAAG,IAAI,MAAM,CAAC,WAAW,CAAC,CAAC;AAE7C,SAAS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AC,CAAC;SACrD;KACF;IACD,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;QAChD,MAAM,IAAI,KAAK,CACb,iBAAiB,SAAS,aAAa,UAAU,oDAAoD,CACtG,CAAC;KACH;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;GAIG;AACH,SAAS,oBAAoB;IAC3B,IAAI,IAAA,0BAAmB,EAAC,mBAAmB,CAAC,KAAK,sBAAsB,EAAE;QACvE,OAAO,WAAW,CAAC;KACpB;SAAM;QACL,OAAO,8BAA8B,CAAC;KACvC;AACH,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,uBAAuB,CACrC,QAAkB,EAClB,OAAe,EACf,UAAiD;IAEjD,OAAO,eAAe,CACpB,QAAQ,EACR,OAAO,EACP,oBAAoB,EAAE,EACtB,UAAU,EACV,UAAU,CACX,CAAC;AACJ,CAAC;AAZD,0DAYC;AAED;;;;;;;;GAQG;AACH,SAAgB,qBAAqB,CACnC,QAAkB,EAClB,OAAe,EACf,UAAiD;IAEjD,OAAO,eAAe,CACpB,QAAQ,EACR,OAAO,EACP,oBAAoB,EAAE,EACtB,QAAQ,EACR,UAAU,CACX,CAAC;AACJ,CAAC;AAZD,sDAYC;AAED;;;;;;;;GAQG;AACH,SAAgB,2BAA2B,CACzC,QAAkB,EAClB,OAAe,EACf,UAAiD;IAEjD,OAAO,CACL,eAAe,CACb,QAAQ,EACR,OAAO,EACP,oBAAoB,EAAE,EACtB,eAAe,EACf,UAAU,CACX,IAAI,IAAA,0BAAmB,EAAC,kBAAkB,CAAC,CAAC,oEAAoE;KAClH,CAAC;AACJ,CAAC;AAdD,kEAcC"} \ No newline at end of file diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json index a923100fc8..8c98f8c387 100644 --- a/node_modules/.package-lock.json +++ b/node_modules/.package-lock.json @@ -1772,13 +1772,6 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/charenc": { - "version": "0.0.2", - "integrity": "sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc=", - "engines": { - "node": "*" - } - }, "node_modules/chokidar": { "version": "3.5.3", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", @@ -1968,14 +1961,6 @@ "node": ">= 0.8" } }, - "node_modules/commander": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-8.1.0.tgz", - "integrity": "sha512-mf45ldcuHSYShkplHHGKWb4TrmwQadxOn7v4WuhDJy0ZVoY5JFajaRDKD0PNe5qXzBX0rhovjTnP6Kz9LETcuA==", - "engines": { - "node": ">= 12" - } - }, "node_modules/common-path-prefix": { "version": "3.0.0", "integrity": "sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==", @@ -2031,13 +2016,6 @@ "node": ">= 8" } }, - "node_modules/crypt": { - "version": "0.0.2", - "integrity": "sha1-iNf/fsDfuG9xPch7u0LQRNPmxBs=", - "engines": { - "node": "*" - } - }, "node_modules/currently-unhandled": { "version": "0.4.1", "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", @@ -3436,23 +3414,6 @@ "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" } }, - "node_modules/glob": { - "version": "9.2.1", - "resolved": "https://registry.npmjs.org/glob/-/glob-9.2.1.tgz", - "integrity": "sha512-Pxxgq3W0HyA3XUvSXcFhRSs+43Jsx0ddxcFrbjxNGkL2Ak5BAUBxLqI5G6ADDeCHLfzzXFhe0b1yYcctGmytMA==", - "dependencies": { - "fs.realpath": "^1.0.0", - "minimatch": "^7.4.1", - "minipass": "^4.2.4", - "path-scurry": "^1.6.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/glob-parent": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", @@ -3464,28 +3425,6 @@ "node": ">= 6" } }, - "node_modules/glob/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/glob/node_modules/minimatch": { - "version": "7.4.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-7.4.2.tgz", - "integrity": "sha512-xy4q7wou3vUoC9k1xGTXc+awNdGaGVHtFUaey8tiX4H1QRc04DZ/rmDFwNm2EBsuYEhAZ6SgMmYf3InGY6OauA==", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/globals": { "version": "13.19.0", "resolved": "https://registry.npmjs.org/globals/-/globals-13.19.0.tgz", @@ -3821,10 +3760,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-buffer": { - "version": "1.1.6", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" - }, "node_modules/is-callable": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", @@ -4387,16 +4322,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/md5": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/md5/-/md5-2.3.0.tgz", - "integrity": "sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==", - "dependencies": { - "charenc": "0.0.2", - "crypt": "0.0.2", - "is-buffer": "~1.1.6" - } - }, "node_modules/md5-hex": { "version": "3.0.1", "integrity": "sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==", @@ -4501,14 +4426,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/minipass": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-4.2.4.tgz", - "integrity": "sha512-lwycX3cBMTvcejsHITUgYj6Gy6A7Nh4Q6h9NP4sTHY1ccJlC7yKzDmiShEHsJ16Jf1nKGDEaiHxiltsJEvk0nQ==", - "engines": { - "node": ">=8" - } - }, "node_modules/ms": { "version": "2.1.2", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", @@ -4938,29 +4855,6 @@ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true }, - "node_modules/path-scurry": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.6.1.tgz", - "integrity": "sha512-OW+5s+7cw6253Q4E+8qQ/u1fVvcJQCJo/VFD8pje+dbJCF1n5ZRMV2AEHbGp+5Q7jxQIYJxkHopnj6nzdGeZLA==", - "dependencies": { - "lru-cache": "^7.14.1", - "minipass": "^4.0.2" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/path-scurry/node_modules/lru-cache": { - "version": "7.18.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", - "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", - "engines": { - "node": ">=12" - } - }, "node_modules/path-to-regexp": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", @@ -6151,9 +6045,9 @@ } }, "node_modules/xml2js": { - "version": "0.4.23", - "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz", - "integrity": "sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.5.0.tgz", + "integrity": "sha512-drPFnkQJik/O+uPKpqSgr22mpuFHqKdbS835iAQrUC73L2F5WkboIRd63ai/2Yg6I1jzifPFKH2NTK+cfglkIA==", "dependencies": { "sax": ">=0.6.0", "xmlbuilder": "~11.0.0" diff --git a/node_modules/charenc/LICENSE.mkd b/node_modules/charenc/LICENSE.mkd deleted file mode 100644 index 96d4c428ea..0000000000 --- a/node_modules/charenc/LICENSE.mkd +++ /dev/null @@ -1,27 +0,0 @@ -Copyright © 2011, Paul Vorbach. All rights reserved. -Copyright © 2009, Jeff Mott. All rights reserved. - -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright notice, this - list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. -* Neither the name Crypto-JS nor the names of its contributors may be used to - endorse or promote products derived from this software without specific prior - written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/charenc/README.js b/node_modules/charenc/README.js deleted file mode 100644 index cfb1baa0d2..0000000000 --- a/node_modules/charenc/README.js +++ /dev/null @@ -1 +0,0 @@ -**enc** provides crypto character encoding utilities. diff --git a/node_modules/charenc/charenc.js b/node_modules/charenc/charenc.js deleted file mode 100644 index 6627f9d2ca..0000000000 --- a/node_modules/charenc/charenc.js +++ /dev/null @@ -1,33 +0,0 @@ -var charenc = { - // UTF-8 encoding - utf8: { - // Convert a string to a byte array - stringToBytes: function(str) { - return charenc.bin.stringToBytes(unescape(encodeURIComponent(str))); - }, - - // Convert a byte array to a string - bytesToString: function(bytes) { - return decodeURIComponent(escape(charenc.bin.bytesToString(bytes))); - } - }, - - // Binary encoding - bin: { - // Convert a string to a byte array - stringToBytes: function(str) { - for (var bytes = [], i = 0; i < str.length; i++) - bytes.push(str.charCodeAt(i) & 0xFF); - return bytes; - }, - - // Convert a byte array to a string - bytesToString: function(bytes) { - for (var str = [], i = 0; i < bytes.length; i++) - str.push(String.fromCharCode(bytes[i])); - return str.join(''); - } - } -}; - -module.exports = charenc; diff --git a/node_modules/charenc/package.json b/node_modules/charenc/package.json deleted file mode 100644 index aece310799..0000000000 --- a/node_modules/charenc/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "author": "Paul Vorbach (http://vorb.de)", - "name": "charenc", - "description": "character encoding utilities", - "tags": [ - "utf8", - "binary", - "byte", - "string" - ], - "version": "0.0.2", - "license": "BSD-3-Clause", - "repository": { - "type": "git", - "url": "git://github.com/pvorb/node-charenc.git" - }, - "bugs": { - "url": "https://github.com/pvorb/node-charenc/issues" - }, - "main": "charenc.js", - "engines": { - "node": "*" - } -} diff --git a/node_modules/commander/LICENSE b/node_modules/commander/LICENSE deleted file mode 100644 index 10f997ab10..0000000000 --- a/node_modules/commander/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -(The MIT License) - -Copyright (c) 2011 TJ Holowaychuk - -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. diff --git a/node_modules/commander/Readme.md b/node_modules/commander/Readme.md deleted file mode 100644 index 4cc640b945..0000000000 --- a/node_modules/commander/Readme.md +++ /dev/null @@ -1,1006 +0,0 @@ -# Commander.js - -[![Build Status](https://github.com/tj/commander.js/workflows/build/badge.svg)](https://github.com/tj/commander.js/actions?query=workflow%3A%22build%22) -[![NPM Version](http://img.shields.io/npm/v/commander.svg?style=flat)](https://www.npmjs.org/package/commander) -[![NPM Downloads](https://img.shields.io/npm/dm/commander.svg?style=flat)](https://npmcharts.com/compare/commander?minimal=true) -[![Install Size](https://packagephobia.now.sh/badge?p=commander)](https://packagephobia.now.sh/result?p=commander) - -The complete solution for [node.js](http://nodejs.org) command-line interfaces. - -Read this in other languages: English | [简体中文](./Readme_zh-CN.md) - -- [Commander.js](#commanderjs) - - [Installation](#installation) - - [Declaring _program_ variable](#declaring-program-variable) - - [Options](#options) - - [Common option types, boolean and value](#common-option-types-boolean-and-value) - - [Default option value](#default-option-value) - - [Other option types, negatable boolean and boolean|value](#other-option-types-negatable-boolean-and-booleanvalue) - - [Required option](#required-option) - - [Variadic option](#variadic-option) - - [Version option](#version-option) - - [More configuration](#more-configuration) - - [Custom option processing](#custom-option-processing) - - [Commands](#commands) - - [Command-arguments](#command-arguments) - - [More configuration](#more-configuration-1) - - [Custom argument processing](#custom-argument-processing) - - [Action handler](#action-handler) - - [Stand-alone executable (sub)commands](#stand-alone-executable-subcommands) - - [Life cycle hooks](#life-cycle-hooks) - - [Automated help](#automated-help) - - [Custom help](#custom-help) - - [Display help after errors](#display-help-after-errors) - - [Display help from code](#display-help-from-code) - - [.usage and .name](#usage-and-name) - - [.helpOption(flags, description)](#helpoptionflags-description) - - [.addHelpCommand()](#addhelpcommand) - - [More configuration](#more-configuration-2) - - [Custom event listeners](#custom-event-listeners) - - [Bits and pieces](#bits-and-pieces) - - [.parse() and .parseAsync()](#parse-and-parseasync) - - [Parsing Configuration](#parsing-configuration) - - [Legacy options as properties](#legacy-options-as-properties) - - [TypeScript](#typescript) - - [createCommand()](#createcommand) - - [Node options such as `--harmony`](#node-options-such-as---harmony) - - [Debugging stand-alone executable subcommands](#debugging-stand-alone-executable-subcommands) - - [Override exit and output handling](#override-exit-and-output-handling) - - [Additional documentation](#additional-documentation) - - [Examples](#examples) - - [Support](#support) - - [Commander for enterprise](#commander-for-enterprise) - -For information about terms used in this document see: [terminology](./docs/terminology.md) - -## Installation - -```bash -npm install commander -``` - -## Declaring _program_ variable - -Commander exports a global object which is convenient for quick programs. -This is used in the examples in this README for brevity. - -```js -const { program } = require('commander'); -program.version('0.0.1'); -``` - -For larger programs which may use commander in multiple ways, including unit testing, it is better to create a local Command object to use. - -```js -const { Command } = require('commander'); -const program = new Command(); -program.version('0.0.1'); -``` - -For named imports in ECMAScript modules, import from `commander/esm.mjs`. - -```js -// index.mjs -import { Command } from 'commander/esm.mjs'; -const program = new Command(); -``` - -And in TypeScript: - -```ts -// index.ts -import { Command } from 'commander'; -const program = new Command(); -``` - - -## Options - -Options are defined with the `.option()` method, also serving as documentation for the options. Each option can have a short flag (single character) and a long name, separated by a comma or space or vertical bar ('|'). - -The parsed options can be accessed by calling `.opts()` on a `Command` object, and are passed to the action handler. -You can also use `.getOptionValue()` and `.setOptionValue()` to work with a single option value. - -Multi-word options such as "--template-engine" are camel-cased, becoming `program.opts().templateEngine` etc. - -Multiple short flags may optionally be combined in a single argument following the dash: boolean flags, followed by a single option taking a value (possibly followed by the value). -For example `-a -b -p 80` may be written as `-ab -p80` or even `-abp80`. - -You can use `--` to indicate the end of the options, and any remaining arguments will be used without being interpreted. - -By default options on the command line are not positional, and can be specified before or after other arguments. - -### Common option types, boolean and value - -The two most used option types are a boolean option, and an option which takes its value -from the following argument (declared with angle brackets like `--expect `). Both are `undefined` unless specified on command line. - -Example file: [options-common.js](./examples/options-common.js) - -```js -program - .option('-d, --debug', 'output extra debugging') - .option('-s, --small', 'small pizza size') - .option('-p, --pizza-type ', 'flavour of pizza'); - -program.parse(process.argv); - -const options = program.opts(); -if (options.debug) console.log(options); -console.log('pizza details:'); -if (options.small) console.log('- small pizza size'); -if (options.pizzaType) console.log(`- ${options.pizzaType}`); -``` - -```bash -$ pizza-options -p -error: option '-p, --pizza-type ' argument missing -$ pizza-options -d -s -p vegetarian -{ debug: true, small: true, pizzaType: 'vegetarian' } -pizza details: -- small pizza size -- vegetarian -$ pizza-options --pizza-type=cheese -pizza details: -- cheese -``` - -`program.parse(arguments)` processes the arguments, leaving any args not consumed by the program options in the `program.args` array. The parameter is optional and defaults to `process.argv`. - -### Default option value - -You can specify a default value for an option which takes a value. - -Example file: [options-defaults.js](./examples/options-defaults.js) - -```js -program - .option('-c, --cheese ', 'add the specified type of cheese', 'blue'); - -program.parse(); - -console.log(`cheese: ${program.opts().cheese}`); -``` - -```bash -$ pizza-options -cheese: blue -$ pizza-options --cheese stilton -cheese: stilton -``` - -### Other option types, negatable boolean and boolean|value - -You can define a boolean option long name with a leading `no-` to set the option value to false when used. -Defined alone this also makes the option true by default. - -If you define `--foo` first, adding `--no-foo` does not change the default value from what it would -otherwise be. You can specify a default boolean value for a boolean option and it can be overridden on command line. - -Example file: [options-negatable.js](./examples/options-negatable.js) - -```js -program - .option('--no-sauce', 'Remove sauce') - .option('--cheese ', 'cheese flavour', 'mozzarella') - .option('--no-cheese', 'plain with no cheese') - .parse(); - -const options = program.opts(); -const sauceStr = options.sauce ? 'sauce' : 'no sauce'; -const cheeseStr = (options.cheese === false) ? 'no cheese' : `${options.cheese} cheese`; -console.log(`You ordered a pizza with ${sauceStr} and ${cheeseStr}`); -``` - -```bash -$ pizza-options -You ordered a pizza with sauce and mozzarella cheese -$ pizza-options --sauce -error: unknown option '--sauce' -$ pizza-options --cheese=blue -You ordered a pizza with sauce and blue cheese -$ pizza-options --no-sauce --no-cheese -You ordered a pizza with no sauce and no cheese -``` - -You can specify an option which may be used as a boolean option but may optionally take an option-argument -(declared with square brackets like `--optional [value]`). - -Example file: [options-boolean-or-value.js](./examples/options-boolean-or-value.js) - -```js -program - .option('-c, --cheese [type]', 'Add cheese with optional type'); - -program.parse(process.argv); - -const options = program.opts(); -if (options.cheese === undefined) console.log('no cheese'); -else if (options.cheese === true) console.log('add cheese'); -else console.log(`add cheese type ${options.cheese}`); -``` - -```bash -$ pizza-options -no cheese -$ pizza-options --cheese -add cheese -$ pizza-options --cheese mozzarella -add cheese type mozzarella -``` - -For information about possible ambiguous cases, see [options taking varying arguments](./docs/options-taking-varying-arguments.md). - -### Required option - -You may specify a required (mandatory) option using `.requiredOption`. The option must have a value after parsing, usually specified on the command line, or perhaps from a default value (say from environment). The method is otherwise the same as `.option` in format, taking flags and description, and optional default value or custom processing. - -Example file: [options-required.js](./examples/options-required.js) - -```js -program - .requiredOption('-c, --cheese ', 'pizza must have cheese'); - -program.parse(); -``` - -```bash -$ pizza -error: required option '-c, --cheese ' not specified -``` - -### Variadic option - -You may make an option variadic by appending `...` to the value placeholder when declaring the option. On the command line you -can then specify multiple option-arguments, and the parsed option value will be an array. The extra arguments -are read until the first argument starting with a dash. The special argument `--` stops option processing entirely. If a value -is specified in the same argument as the option then no further values are read. - -Example file: [options-variadic.js](./examples/options-variadic.js) - -```js -program - .option('-n, --number ', 'specify numbers') - .option('-l, --letter [letters...]', 'specify letters'); - -program.parse(); - -console.log('Options: ', program.opts()); -console.log('Remaining arguments: ', program.args); -``` - -```bash -$ collect -n 1 2 3 --letter a b c -Options: { number: [ '1', '2', '3' ], letter: [ 'a', 'b', 'c' ] } -Remaining arguments: [] -$ collect --letter=A -n80 operand -Options: { number: [ '80' ], letter: [ 'A' ] } -Remaining arguments: [ 'operand' ] -$ collect --letter -n 1 -n 2 3 -- operand -Options: { number: [ '1', '2', '3' ], letter: true } -Remaining arguments: [ 'operand' ] -``` - -For information about possible ambiguous cases, see [options taking varying arguments](./docs/options-taking-varying-arguments.md). - -### Version option - -The optional `version` method adds handling for displaying the command version. The default option flags are `-V` and `--version`, and when present the command prints the version number and exits. - -```js -program.version('0.0.1'); -``` - -```bash -$ ./examples/pizza -V -0.0.1 -``` - -You may change the flags and description by passing additional parameters to the `version` method, using -the same syntax for flags as the `option` method. - -```js -program.version('0.0.1', '-v, --vers', 'output the current version'); -``` - -### More configuration - -You can add most options using the `.option()` method, but there are some additional features available -by constructing an `Option` explicitly for less common cases. - -Example file: [options-extra.js](./examples/options-extra.js) - -```js -program - .addOption(new Option('-s, --secret').hideHelp()) - .addOption(new Option('-t, --timeout ', 'timeout in seconds').default(60, 'one minute')) - .addOption(new Option('-d, --drink ', 'drink size').choices(['small', 'medium', 'large'])); -``` - -```bash -$ extra --help -Usage: help [options] - -Options: - -t, --timeout timeout in seconds (default: one minute) - -d, --drink drink cup size (choices: "small", "medium", "large") - -h, --help display help for command - -$ extra --drink huge -error: option '-d, --drink ' argument 'huge' is invalid. Allowed choices are small, medium, large. -``` - -### Custom option processing - -You may specify a function to do custom processing of option-arguments. The callback function receives two parameters, -the user specified option-argument and the previous value for the option. It returns the new value for the option. - -This allows you to coerce the option-argument to the desired type, or accumulate values, or do entirely custom processing. - -You can optionally specify the default/starting value for the option after the function parameter. - -Example file: [options-custom-processing.js](./examples/options-custom-processing.js) - -```js -function myParseInt(value, dummyPrevious) { - // parseInt takes a string and a radix - const parsedValue = parseInt(value, 10); - if (isNaN(parsedValue)) { - throw new commander.InvalidArgumentError('Not a number.'); - } - return parsedValue; -} - -function increaseVerbosity(dummyValue, previous) { - return previous + 1; -} - -function collect(value, previous) { - return previous.concat([value]); -} - -function commaSeparatedList(value, dummyPrevious) { - return value.split(','); -} - -program - .option('-f, --float ', 'float argument', parseFloat) - .option('-i, --integer ', 'integer argument', myParseInt) - .option('-v, --verbose', 'verbosity that can be increased', increaseVerbosity, 0) - .option('-c, --collect ', 'repeatable value', collect, []) - .option('-l, --list ', 'comma separated list', commaSeparatedList) -; - -program.parse(); - -const options = program.opts(); -if (options.float !== undefined) console.log(`float: ${options.float}`); -if (options.integer !== undefined) console.log(`integer: ${options.integer}`); -if (options.verbose > 0) console.log(`verbosity: ${options.verbose}`); -if (options.collect.length > 0) console.log(options.collect); -if (options.list !== undefined) console.log(options.list); -``` - -```bash -$ custom -f 1e2 -float: 100 -$ custom --integer 2 -integer: 2 -$ custom -v -v -v -verbose: 3 -$ custom -c a -c b -c c -[ 'a', 'b', 'c' ] -$ custom --list x,y,z -[ 'x', 'y', 'z' ] -``` - -## Commands - -You can specify (sub)commands using `.command()` or `.addCommand()`. There are two ways these can be implemented: using an action handler attached to the command, or as a stand-alone executable file (described in more detail later). The subcommands may be nested ([example](./examples/nestedCommands.js)). - -In the first parameter to `.command()` you specify the command name. You may append the command-arguments after the command name, or specify them separately using `.argument()`. The arguments may be `` or `[optional]`, and the last argument may also be `variadic...`. - -You can use `.addCommand()` to add an already configured subcommand to the program. - -For example: - -```js -// Command implemented using action handler (description is supplied separately to `.command`) -// Returns new command for configuring. -program - .command('clone [destination]') - .description('clone a repository into a newly created directory') - .action((source, destination) => { - console.log('clone command called'); - }); - -// Command implemented using stand-alone executable file, indicated by adding description as second parameter to `.command`. -// Returns `this` for adding more commands. -program - .command('start ', 'start named service') - .command('stop [service]', 'stop named service, or all if no name supplied'); - -// Command prepared separately. -// Returns `this` for adding more commands. -program - .addCommand(build.makeBuildCommand()); -``` - -Configuration options can be passed with the call to `.command()` and `.addCommand()`. Specifying `hidden: true` will -remove the command from the generated help output. Specifying `isDefault: true` will run the subcommand if no other -subcommand is specified ([example](./examples/defaultCommand.js)). - -### Command-arguments - -For subcommands, you can specify the argument syntax in the call to `.command()` (as shown above). This -is the only method usable for subcommands implemented using a stand-alone executable, but for other subcommands -you can instead use the following method. - -To configure a command, you can use `.argument()` to specify each expected command-argument. -You supply the argument name and an optional description. The argument may be `` or `[optional]`. -You can specify a default value for an optional command-argument. - -Example file: [argument.js](./examples/argument.js) - -```js -program - .version('0.1.0') - .argument('', 'user to login') - .argument('[password]', 'password for user, if required', 'no password given') - .action((username, password) => { - console.log('username:', username); - console.log('password:', password); - }); -``` - - The last argument of a command can be variadic, and only the last argument. To make an argument variadic you - append `...` to the argument name. A variadic argument is passed to the action handler as an array. For example: - -```js -program - .version('0.1.0') - .command('rmdir') - .argument('') - .action(function (dirs) { - dirs.forEach((dir) => { - console.log('rmdir %s', dir); - }); - }); -``` - -There is a convenience method to add multiple arguments at once, but without descriptions: - -```js -program - .arguments(' '); -``` - -#### More configuration - -There are some additional features available by constructing an `Argument` explicitly for less common cases. - -Example file: [arguments-extra.js](./examples/arguments-extra.js) - -```js -program - .addArgument(new commander.Argument('', 'drink cup size').choices(['small', 'medium', 'large'])) - .addArgument(new commander.Argument('[timeout]', 'timeout in seconds').default(60, 'one minute')) -``` - -#### Custom argument processing - -You may specify a function to do custom processing of command-arguments (like for option-arguments). -The callback function receives two parameters, the user specified command-argument and the previous value for the argument. -It returns the new value for the argument. - -The processed argument values are passed to the action handler, and saved as `.processedArgs`. - -You can optionally specify the default/starting value for the argument after the function parameter. - -Example file: [arguments-custom-processing.js](./examples/arguments-custom-processing.js) - -```js -program - .command('add') - .argument('', 'integer argument', myParseInt) - .argument('[second]', 'integer argument', myParseInt, 1000) - .action((first, second) => { - console.log(`${first} + ${second} = ${first + second}`); - }) -; -``` - -### Action handler - -The action handler gets passed a parameter for each command-argument you declared, and two additional parameters -which are the parsed options and the command object itself. - -Example file: [thank.js](./examples/thank.js) - -```js -program - .argument('') - .option('-t, --title ', 'title to use before name') - .option('-d, --debug', 'display some debugging') - .action((name, options, command) => { - if (options.debug) { - console.error('Called %s with options %o', command.name(), options); - } - const title = options.title ? `${options.title} ` : ''; - console.log(`Thank-you ${title}${name}`); - }); -``` - -You may supply an `async` action handler, in which case you call `.parseAsync` rather than `.parse`. - -```js -async function run() { /* code goes here */ } - -async function main() { - program - .command('run') - .action(run); - await program.parseAsync(process.argv); -} -``` - -A command's options and arguments on the command line are validated when the command is used. Any unknown options or missing arguments will be reported as an error. You can suppress the unknown option checks with `.allowUnknownOption()`. By default it is not an error to -pass more arguments than declared, but you can make this an error with `.allowExcessArguments(false)`. - -### Stand-alone executable (sub)commands - -When `.command()` is invoked with a description argument, this tells Commander that you're going to use stand-alone executables for subcommands. -Commander will search the executables in the directory of the entry script (like `./examples/pm`) with the name `program-subcommand`, like `pm-install`, `pm-search`. -You can specify a custom name with the `executableFile` configuration option. - -You handle the options for an executable (sub)command in the executable, and don't declare them at the top-level. - -Example file: [pm](./examples/pm) - -```js -program - .version('0.1.0') - .command('install [name]', 'install one or more packages') - .command('search [query]', 'search with optional query') - .command('update', 'update installed packages', { executableFile: 'myUpdateSubCommand' }) - .command('list', 'list packages installed', { isDefault: true }); - -program.parse(process.argv); -``` - -If the program is designed to be installed globally, make sure the executables have proper modes, like `755`. - -### Life cycle hooks - -You can add callback hooks to a command for life cycle events. - -Example file: [hook.js](./examples/hook.js) - -```js -program - .option('-t, --trace', 'display trace statements for commands') - .hook('preAction', (thisCommand, actionCommand) => { - if (thisCommand.opts().trace) { - console.log(`About to call action handler for subcommand: ${actionCommand.name()}`); - console.log('arguments: %O', actionCommand.args); - console.log('options: %o', actionCommand.opts()); - } - }); -``` - -The callback hook can be `async`, in which case you call `.parseAsync` rather than `.parse`. You can add multiple hooks per event. - -The supported events are: - -- `preAction`: called before action handler for this command and its subcommands -- `postAction`: called after action handler for this command and its subcommands - -The hook is passed the command it was added to, and the command running the action handler. - -## Automated help - -The help information is auto-generated based on the information commander already knows about your program. The default -help option is `-h,--help`. - -Example file: [pizza](./examples/pizza) - -```bash -$ node ./examples/pizza --help -Usage: pizza [options] - -An application for pizza ordering - -Options: - -p, --peppers Add peppers - -c, --cheese Add the specified type of cheese (default: "marble") - -C, --no-cheese You do not want any cheese - -h, --help display help for command -``` - -A `help` command is added by default if your command has subcommands. It can be used alone, or with a subcommand name to show -further help for the subcommand. These are effectively the same if the `shell` program has implicit help: - -```bash -shell help -shell --help - -shell help spawn -shell spawn --help -``` - -### Custom help - -You can add extra text to be displayed along with the built-in help. - -Example file: [custom-help](./examples/custom-help) - -```js -program - .option('-f, --foo', 'enable some foo'); - -program.addHelpText('after', ` - -Example call: - $ custom-help --help`); -``` - -Yields the following help output: - -```Text -Usage: custom-help [options] - -Options: - -f, --foo enable some foo - -h, --help display help for command - -Example call: - $ custom-help --help -``` - -The positions in order displayed are: - -- `beforeAll`: add to the program for a global banner or header -- `before`: display extra information before built-in help -- `after`: display extra information after built-in help -- `afterAll`: add to the program for a global footer (epilog) - -The positions "beforeAll" and "afterAll" apply to the command and all its subcommands. - -The second parameter can be a string, or a function returning a string. The function is passed a context object for your convenience. The properties are: - -- error: a boolean for whether the help is being displayed due to a usage error -- command: the Command which is displaying the help - -### Display help after errors - -The default behaviour for usage errors is to just display a short error message. -You can change the behaviour to show the full help or a custom help message after an error. - -```js -program.showHelpAfterError(); -// or -program.showHelpAfterError('(add --help for additional information)'); -``` - -```sh -$ pizza --unknown -error: unknown option '--unknown' -(add --help for additional information) -``` - -### Display help from code - -`.help()`: display help information and exit immediately. You can optionally pass `{ error: true }` to display on stderr and exit with an error status. - -`.outputHelp()`: output help information without exiting. You can optionally pass `{ error: true }` to display on stderr. - -`.helpInformation()`: get the built-in command help information as a string for processing or displaying yourself. - -### .usage and .name - -These allow you to customise the usage description in the first line of the help. The name is otherwise -deduced from the (full) program arguments. Given: - -```js -program - .name("my-command") - .usage("[global options] command") -``` - -The help will start with: - -```Text -Usage: my-command [global options] command -``` - -### .helpOption(flags, description) - -By default every command has a help option. Override the default help flags and description. Pass false to disable the built-in help option. - -```js -program - .helpOption('-e, --HELP', 'read more information'); -``` - -### .addHelpCommand() - -A help command is added by default if your command has subcommands. You can explicitly turn on or off the implicit help command with `.addHelpCommand()` and `.addHelpCommand(false)`. - -You can both turn on and customise the help command by supplying the name and description: - -```js -program.addHelpCommand('assist [command]', 'show assistance'); -``` - -### More configuration - -The built-in help is formatted using the Help class. -You can configure the Help behaviour by modifying data properties and methods using `.configureHelp()`, or by subclassing using `.createHelp()` if you prefer. - -The data properties are: - -- `helpWidth`: specify the wrap width, useful for unit tests -- `sortSubcommands`: sort the subcommands alphabetically -- `sortOptions`: sort the options alphabetically - -There are methods getting the visible lists of arguments, options, and subcommands. There are methods for formatting the items in the lists, with each item having a _term_ and _description_. Take a look at `.formatHelp()` to see how they are used. - -Example file: [configure-help.js](./examples/configure-help.js) - -```js -program.configureHelp({ - sortSubcommands: true, - subcommandTerm: (cmd) => cmd.name() // Just show the name, instead of short usage. -}); -``` - -## Custom event listeners - -You can execute custom actions by listening to command and option events. - -```js -program.on('option:verbose', function () { - process.env.VERBOSE = this.opts().verbose; -}); - -program.on('command:*', function (operands) { - console.error(`error: unknown command '${operands[0]}'`); - const availableCommands = program.commands.map(cmd => cmd.name()); - mySuggestBestMatch(operands[0], availableCommands); - process.exitCode = 1; -}); -``` - -## Bits and pieces - -### .parse() and .parseAsync() - -The first argument to `.parse` is the array of strings to parse. You may omit the parameter to implicitly use `process.argv`. - -If the arguments follow different conventions than node you can pass a `from` option in the second parameter: - -- 'node': default, `argv[0]` is the application and `argv[1]` is the script being run, with user parameters after that -- 'electron': `argv[1]` varies depending on whether the electron application is packaged -- 'user': all of the arguments from the user - -For example: - -```js -program.parse(process.argv); // Explicit, node conventions -program.parse(); // Implicit, and auto-detect electron -program.parse(['-f', 'filename'], { from: 'user' }); -``` - -### Parsing Configuration - -If the default parsing does not suit your needs, there are some behaviours to support other usage patterns. - -By default program options are recognised before and after subcommands. To only look for program options before subcommands, use `.enablePositionalOptions()`. This lets you use -an option for a different purpose in subcommands. - -Example file: [positional-options.js](./examples/positional-options.js) - -With positional options, the `-b` is a program option in the first line and a subcommand option in the second line: - -```sh -program -b subcommand -program subcommand -b -``` - -By default options are recognised before and after command-arguments. To only process options that come -before the command-arguments, use `.passThroughOptions()`. This lets you pass the arguments and following options through to another program -without needing to use `--` to end the option processing. -To use pass through options in a subcommand, the program needs to enable positional options. - -Example file: [pass-through-options.js](./examples/pass-through-options.js) - -With pass through options, the `--port=80` is a program option in the first line and passed through as a command-argument in the second line: - -```sh -program --port=80 arg -program arg --port=80 -``` - -By default the option processing shows an error for an unknown option. To have an unknown option treated as an ordinary command-argument and continue looking for options, use `.allowUnknownOption()`. This lets you mix known and unknown options. - -By default the argument processing does not display an error for more command-arguments than expected. -To display an error for excess arguments, use`.allowExcessArguments(false)`. - -### Legacy options as properties - -Before Commander 7, the option values were stored as properties on the command. -This was convenient to code but the downside was possible clashes with -existing properties of `Command`. You can revert to the old behaviour to run unmodified legacy code by using `.storeOptionsAsProperties()`. - -```js -program - .storeOptionsAsProperties() - .option('-d, --debug') - .action((commandAndOptions) => { - if (commandAndOptions.debug) { - console.error(`Called ${commandAndOptions.name()}`); - } - }); -``` - -### TypeScript - -If you use `ts-node` and stand-alone executable subcommands written as `.ts` files, you need to call your program through node to get the subcommands called correctly. e.g. - -```bash -node -r ts-node/register pm.ts -``` - -### createCommand() - -This factory function creates a new command. It is exported and may be used instead of using `new`, like: - -```js -const { createCommand } = require('commander'); -const program = createCommand(); -``` - -`createCommand` is also a method of the Command object, and creates a new command rather than a subcommand. This gets used internally -when creating subcommands using `.command()`, and you may override it to -customise the new subcommand (example file [custom-command-class.js](./examples/custom-command-class.js)). - -### Node options such as `--harmony` - -You can enable `--harmony` option in two ways: - -- Use `#! /usr/bin/env node --harmony` in the subcommands scripts. (Note Windows does not support this pattern.) -- Use the `--harmony` option when call the command, like `node --harmony examples/pm publish`. The `--harmony` option will be preserved when spawning subcommand process. - -### Debugging stand-alone executable subcommands - -An executable subcommand is launched as a separate child process. - -If you are using the node inspector for [debugging](https://nodejs.org/en/docs/guides/debugging-getting-started/) executable subcommands using `node --inspect` et al, -the inspector port is incremented by 1 for the spawned subcommand. - -If you are using VSCode to debug executable subcommands you need to set the `"autoAttachChildProcesses": true` flag in your launch.json configuration. - -### Override exit and output handling - -By default Commander calls `process.exit` when it detects errors, or after displaying the help or version. You can override -this behaviour and optionally supply a callback. The default override throws a `CommanderError`. - -The override callback is passed a `CommanderError` with properties `exitCode` number, `code` string, and `message`. The default override behaviour is to throw the error, except for async handling of executable subcommand completion which carries on. The normal display of error messages or version or help -is not affected by the override which is called after the display. - -```js -program.exitOverride(); - -try { - program.parse(process.argv); -} catch (err) { - // custom processing... -} -``` - -By default Commander is configured for a command-line application and writes to stdout and stderr. -You can modify this behaviour for custom applications. In addition, you can modify the display of error messages. - -Example file: [configure-output.js](./examples/configure-output.js) - - -```js -function errorColor(str) { - // Add ANSI escape codes to display text in red. - return `\x1b[31m${str}\x1b[0m`; -} - -program - .configureOutput({ - // Visibly override write routines as example! - writeOut: (str) => process.stdout.write(`[OUT] ${str}`), - writeErr: (str) => process.stdout.write(`[ERR] ${str}`), - // Highlight errors in color. - outputError: (str, write) => write(errorColor(str)) - }); -``` - -### Additional documentation - -There is more information available about: - -- [deprecated](./docs/deprecated.md) features still supported for backwards compatibility -- [options taking varying arguments](./docs/options-taking-varying-arguments.md) - -## Examples - -In a single command program, you might not need an action handler. - -Example file: [pizza](./examples/pizza) - -```js -const { program } = require('commander'); - -program - .description('An application for pizza ordering') - .option('-p, --peppers', 'Add peppers') - .option('-c, --cheese ', 'Add the specified type of cheese', 'marble') - .option('-C, --no-cheese', 'You do not want any cheese'); - -program.parse(); - -const options = program.opts(); -console.log('you ordered a pizza with:'); -if (options.peppers) console.log(' - peppers'); -const cheese = !options.cheese ? 'no' : options.cheese; -console.log(' - %s cheese', cheese); -``` - -In a multi-command program, you will have action handlers for each command (or stand-alone executables for the commands). - -Example file: [deploy](./examples/deploy) - -```js -const { Command } = require('commander'); -const program = new Command(); - -program - .version('0.0.1') - .option('-c, --config ', 'set config path', './deploy.conf'); - -program - .command('setup [env]') - .description('run setup commands for all envs') - .option('-s, --setup_mode ', 'Which setup mode to use', 'normal') - .action((env, options) => { - env = env || 'all'; - console.log('read config from %s', program.opts().config); - console.log('setup for %s env(s) with %s mode', env, options.setup_mode); - }); - -program - .command('exec - diff --git a/node_modules/md5/dist/md5.min.js b/node_modules/md5/dist/md5.min.js deleted file mode 100644 index 250ab73569..0000000000 --- a/node_modules/md5/dist/md5.min.js +++ /dev/null @@ -1,7 +0,0 @@ -var MD5=function(r){function n(o){if(t[o])return t[o].exports;var e=t[o]={i:o,l:!1,exports:{}};return r[o].call(e.exports,e,e.exports,n),e.l=!0,e.exports}var t={};return n.m=r,n.c=t,n.i=function(r){return r},n.d=function(r,t,o){n.o(r,t)||Object.defineProperty(r,t,{configurable:!1,enumerable:!0,get:o})},n.n=function(r){var t=r&&r.__esModule?function(){return r.default}:function(){return r};return n.d(t,"a",t),t},n.o=function(r,n){return Object.prototype.hasOwnProperty.call(r,n)},n.p="",n(n.s=4)}([function(r,n){var t={utf8:{stringToBytes:function(r){return t.bin.stringToBytes(unescape(encodeURIComponent(r)))},bytesToString:function(r){return decodeURIComponent(escape(t.bin.bytesToString(r)))}},bin:{stringToBytes:function(r){for(var n=[],t=0;t>>24)|4278255360&(f[h]<<24|f[h]>>>8);f[s>>>5]|=128<>>9<<4)]=s;for(var p=i._ff,y=i._gg,v=i._hh,d=i._ii,h=0;h>>0,a=a+T>>>0,l=l+x>>>0,g=g+B>>>0}return n.endian([c,a,l,g])};i._ff=function(r,n,t,o,e,u,i){var f=r+(n&t|~n&o)+(e>>>0)+i;return(f<>>32-u)+n},i._gg=function(r,n,t,o,e,u,i){var f=r+(n&o|t&~o)+(e>>>0)+i;return(f<>>32-u)+n},i._hh=function(r,n,t,o,e,u,i){var f=r+(n^t^o)+(e>>>0)+i;return(f<>>32-u)+n},i._ii=function(r,n,t,o,e,u,i){var f=r+(t^(n|~o))+(e>>>0)+i;return(f<>>32-u)+n},i._blocksize=16,i._digestsize=16,r.exports=function(r,t){if(void 0===r||null===r)throw new Error("Illegal argument "+r);var o=n.wordsToBytes(i(r,t));return t&&t.asBytes?o:t&&t.asString?u.bytesToString(o):n.bytesToHex(o)}}()},function(r,n){!function(){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t={rotl:function(r,n){return r<>>32-n},rotr:function(r,n){return r<<32-n|r>>>n},endian:function(r){if(r.constructor==Number)return 16711935&t.rotl(r,8)|4278255360&t.rotl(r,24);for(var n=0;n0;r--)n.push(Math.floor(256*Math.random()));return n},bytesToWords:function(r){for(var n=[],t=0,o=0;t>>5]|=r[t]<<24-o%32;return n},wordsToBytes:function(r){for(var n=[],t=0;t<32*r.length;t+=8)n.push(r[t>>>5]>>>24-t%32&255);return n},bytesToHex:function(r){for(var n=[],t=0;t>>4).toString(16)),n.push((15&r[t]).toString(16));return n.join("")},hexToBytes:function(r){for(var n=[],t=0;t>>6*(3-u)&63)):t.push("=");return t.join("")},base64ToBytes:function(r){r=r.replace(/[^A-Z0-9+\/]/gi,"");for(var t=[],o=0,e=0;o>>6-2*e);return t}};r.exports=t}()},function(r,n){function t(r){return!!r.constructor&&"function"==typeof r.constructor.isBuffer&&r.constructor.isBuffer(r)}function o(r){return"function"==typeof r.readFloatLE&&"function"==typeof r.slice&&t(r.slice(0,0))}/*! - * Determine if an object is a Buffer - * - * @author Feross Aboukhadijeh - * @license MIT - */ -r.exports=function(r){return null!=r&&(t(r)||o(r)||!!r._isBuffer)}},function(r,n,t){r.exports=t(1)}]); \ No newline at end of file diff --git a/node_modules/md5/md5.js b/node_modules/md5/md5.js deleted file mode 100644 index 0f8905a639..0000000000 --- a/node_modules/md5/md5.js +++ /dev/null @@ -1,160 +0,0 @@ -(function(){ - var crypt = require('crypt'), - utf8 = require('charenc').utf8, - isBuffer = require('is-buffer'), - bin = require('charenc').bin, - - // The core - md5 = function (message, options) { - // Convert to byte array - if (message.constructor == String) - if (options && options.encoding === 'binary') - message = bin.stringToBytes(message); - else - message = utf8.stringToBytes(message); - else if (isBuffer(message)) - message = Array.prototype.slice.call(message, 0); - else if (!Array.isArray(message) && message.constructor !== Uint8Array) - message = message.toString(); - // else, assume byte array already - - var m = crypt.bytesToWords(message), - l = message.length * 8, - a = 1732584193, - b = -271733879, - c = -1732584194, - d = 271733878; - - // Swap endian - for (var i = 0; i < m.length; i++) { - m[i] = ((m[i] << 8) | (m[i] >>> 24)) & 0x00FF00FF | - ((m[i] << 24) | (m[i] >>> 8)) & 0xFF00FF00; - } - - // Padding - m[l >>> 5] |= 0x80 << (l % 32); - m[(((l + 64) >>> 9) << 4) + 14] = l; - - // Method shortcuts - var FF = md5._ff, - GG = md5._gg, - HH = md5._hh, - II = md5._ii; - - for (var i = 0; i < m.length; i += 16) { - - var aa = a, - bb = b, - cc = c, - dd = d; - - a = FF(a, b, c, d, m[i+ 0], 7, -680876936); - d = FF(d, a, b, c, m[i+ 1], 12, -389564586); - c = FF(c, d, a, b, m[i+ 2], 17, 606105819); - b = FF(b, c, d, a, m[i+ 3], 22, -1044525330); - a = FF(a, b, c, d, m[i+ 4], 7, -176418897); - d = FF(d, a, b, c, m[i+ 5], 12, 1200080426); - c = FF(c, d, a, b, m[i+ 6], 17, -1473231341); - b = FF(b, c, d, a, m[i+ 7], 22, -45705983); - a = FF(a, b, c, d, m[i+ 8], 7, 1770035416); - d = FF(d, a, b, c, m[i+ 9], 12, -1958414417); - c = FF(c, d, a, b, m[i+10], 17, -42063); - b = FF(b, c, d, a, m[i+11], 22, -1990404162); - a = FF(a, b, c, d, m[i+12], 7, 1804603682); - d = FF(d, a, b, c, m[i+13], 12, -40341101); - c = FF(c, d, a, b, m[i+14], 17, -1502002290); - b = FF(b, c, d, a, m[i+15], 22, 1236535329); - - a = GG(a, b, c, d, m[i+ 1], 5, -165796510); - d = GG(d, a, b, c, m[i+ 6], 9, -1069501632); - c = GG(c, d, a, b, m[i+11], 14, 643717713); - b = GG(b, c, d, a, m[i+ 0], 20, -373897302); - a = GG(a, b, c, d, m[i+ 5], 5, -701558691); - d = GG(d, a, b, c, m[i+10], 9, 38016083); - c = GG(c, d, a, b, m[i+15], 14, -660478335); - b = GG(b, c, d, a, m[i+ 4], 20, -405537848); - a = GG(a, b, c, d, m[i+ 9], 5, 568446438); - d = GG(d, a, b, c, m[i+14], 9, -1019803690); - c = GG(c, d, a, b, m[i+ 3], 14, -187363961); - b = GG(b, c, d, a, m[i+ 8], 20, 1163531501); - a = GG(a, b, c, d, m[i+13], 5, -1444681467); - d = GG(d, a, b, c, m[i+ 2], 9, -51403784); - c = GG(c, d, a, b, m[i+ 7], 14, 1735328473); - b = GG(b, c, d, a, m[i+12], 20, -1926607734); - - a = HH(a, b, c, d, m[i+ 5], 4, -378558); - d = HH(d, a, b, c, m[i+ 8], 11, -2022574463); - c = HH(c, d, a, b, m[i+11], 16, 1839030562); - b = HH(b, c, d, a, m[i+14], 23, -35309556); - a = HH(a, b, c, d, m[i+ 1], 4, -1530992060); - d = HH(d, a, b, c, m[i+ 4], 11, 1272893353); - c = HH(c, d, a, b, m[i+ 7], 16, -155497632); - b = HH(b, c, d, a, m[i+10], 23, -1094730640); - a = HH(a, b, c, d, m[i+13], 4, 681279174); - d = HH(d, a, b, c, m[i+ 0], 11, -358537222); - c = HH(c, d, a, b, m[i+ 3], 16, -722521979); - b = HH(b, c, d, a, m[i+ 6], 23, 76029189); - a = HH(a, b, c, d, m[i+ 9], 4, -640364487); - d = HH(d, a, b, c, m[i+12], 11, -421815835); - c = HH(c, d, a, b, m[i+15], 16, 530742520); - b = HH(b, c, d, a, m[i+ 2], 23, -995338651); - - a = II(a, b, c, d, m[i+ 0], 6, -198630844); - d = II(d, a, b, c, m[i+ 7], 10, 1126891415); - c = II(c, d, a, b, m[i+14], 15, -1416354905); - b = II(b, c, d, a, m[i+ 5], 21, -57434055); - a = II(a, b, c, d, m[i+12], 6, 1700485571); - d = II(d, a, b, c, m[i+ 3], 10, -1894986606); - c = II(c, d, a, b, m[i+10], 15, -1051523); - b = II(b, c, d, a, m[i+ 1], 21, -2054922799); - a = II(a, b, c, d, m[i+ 8], 6, 1873313359); - d = II(d, a, b, c, m[i+15], 10, -30611744); - c = II(c, d, a, b, m[i+ 6], 15, -1560198380); - b = II(b, c, d, a, m[i+13], 21, 1309151649); - a = II(a, b, c, d, m[i+ 4], 6, -145523070); - d = II(d, a, b, c, m[i+11], 10, -1120210379); - c = II(c, d, a, b, m[i+ 2], 15, 718787259); - b = II(b, c, d, a, m[i+ 9], 21, -343485551); - - a = (a + aa) >>> 0; - b = (b + bb) >>> 0; - c = (c + cc) >>> 0; - d = (d + dd) >>> 0; - } - - return crypt.endian([a, b, c, d]); - }; - - // Auxiliary functions - md5._ff = function (a, b, c, d, x, s, t) { - var n = a + (b & c | ~b & d) + (x >>> 0) + t; - return ((n << s) | (n >>> (32 - s))) + b; - }; - md5._gg = function (a, b, c, d, x, s, t) { - var n = a + (b & d | c & ~d) + (x >>> 0) + t; - return ((n << s) | (n >>> (32 - s))) + b; - }; - md5._hh = function (a, b, c, d, x, s, t) { - var n = a + (b ^ c ^ d) + (x >>> 0) + t; - return ((n << s) | (n >>> (32 - s))) + b; - }; - md5._ii = function (a, b, c, d, x, s, t) { - var n = a + (c ^ (b | ~d)) + (x >>> 0) + t; - return ((n << s) | (n >>> (32 - s))) + b; - }; - - // Package private blocksize - md5._blocksize = 16; - md5._digestsize = 16; - - module.exports = function (message, options) { - if (message === undefined || message === null) - throw new Error('Illegal argument ' + message); - - var digestbytes = crypt.wordsToBytes(md5(message, options)); - return options && options.asBytes ? digestbytes : - options && options.asString ? bin.bytesToString(digestbytes) : - crypt.bytesToHex(digestbytes); - }; - -})(); diff --git a/node_modules/md5/package.json b/node_modules/md5/package.json deleted file mode 100644 index 7618a073ed..0000000000 --- a/node_modules/md5/package.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "md5", - "description": "js function for hashing messages with MD5", - "version": "2.3.0", - "author": "Paul Vorbach (http://paul.vorba.ch)", - "contributors": [ - "salba" - ], - "tags": [ - "md5", - "hash", - "encryption", - "message digest" - ], - "repository": { - "type": "git", - "url": "git://github.com/pvorb/node-md5.git" - }, - "bugs": { - "url": "https://github.com/pvorb/node-md5/issues" - }, - "main": "md5.js", - "scripts": { - "test": "mocha", - "webpack": "webpack -p" - }, - "dependencies": { - "charenc": "0.0.2", - "crypt": "0.0.2", - "is-buffer": "~1.1.6" - }, - "devDependencies": { - "mocha": "~2.3.4", - "webpack": "~2.4.1" - }, - "optionalDependencies": {}, - "license": "BSD-3-Clause" -} diff --git a/node_modules/md5/test.js b/node_modules/md5/test.js deleted file mode 100644 index db78c2549f..0000000000 --- a/node_modules/md5/test.js +++ /dev/null @@ -1,75 +0,0 @@ -var md5 = require('./md5.js'); -var assert = require('assert'); - -describe('md5', function () { - - it('should throw an error for an undefined value', function() { - assert.throws(function() { - md5(undefined); - }); - }); - - it('should allow the hashing of the string `undefined`', function() { - assert.equal('5e543256c480ac577d30f76f9120eb74', md5('undefined')); - }); - - it('should throw an error for `null`', function() { - assert.throws(function() { - md5(null); - }); - }); - - it('should return the expected MD5 hash for "message"', function() { - assert.equal('78e731027d8fd50ed642340b7c9a63b3', md5('message')); - }); - - it('should not return the same hash for random numbers twice', function() { - var msg1 = Math.floor((Math.random() * 100000) + 1) + (new Date).getTime(); - var msg2 = Math.floor((Math.random() * 100000) + 1) + (new Date).getTime(); - - if (msg1 !== msg2) { - assert.notEqual(md5(msg1), md5(msg2)); - } else { - assert.equal(md5(msg1), md5(msg1)); - } - }); - - it('should support Node.js Buffers', function() { - var buffer = new Buffer('message áßäöü', 'utf8'); - - assert.equal(md5(buffer), md5('message áßäöü')); - }) - - it('should be able to use a binary encoded string', function() { - var hash1 = md5('abc', { asString: true }); - var hash2 = md5(hash1 + 'a', { asString: true, encoding : 'binary' }); - var hash3 = md5(hash1 + 'a', { encoding : 'binary' }); - assert.equal(hash3, '131f0ac52813044f5110e4aec638c169'); - }); - - it('should support Uint8Array', function() { - // Polyfills - if (!Array.from) { - Array.from = function(src, fn) { - var result = new Array(src.length); - for (var i = 0; i < src.length; ++i) - result[i] = fn(src[i]); - return result; - }; - } - if (!Uint8Array.from) { - Uint8Array.from = function(src) { - var result = new Uint8Array(src.length); - for (var i = 0; i < src.length; ++i) - result[i] = src[i]; - return result; - }; - } - - var message = 'foobarbaz'; - var u8arr = Uint8Array.from( - Array.from(message, function(c) { return c.charCodeAt(0); })); - var u8aHash = md5(u8arr); - assert.equal(u8aHash, md5(message)); - }); -}); diff --git a/node_modules/md5/webpack.config.js b/node_modules/md5/webpack.config.js deleted file mode 100644 index 310eb37594..0000000000 --- a/node_modules/md5/webpack.config.js +++ /dev/null @@ -1,13 +0,0 @@ -const {resolve} = require('path'); - -module.exports = { - entry: [ - './md5.js' - ], - output: { - path: resolve('./dist'), - filename: 'md5.min.js', - libraryTarget: "var", - library: "MD5" - } -}; \ No newline at end of file diff --git a/node_modules/minipass/LICENSE b/node_modules/minipass/LICENSE deleted file mode 100644 index 97f8e32ed8..0000000000 --- a/node_modules/minipass/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) 2017-2023 npm, Inc., Isaac Z. Schlueter, and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/minipass/README.md b/node_modules/minipass/README.md deleted file mode 100644 index 3cb71e35ed..0000000000 --- a/node_modules/minipass/README.md +++ /dev/null @@ -1,769 +0,0 @@ -# minipass - -A _very_ minimal implementation of a [PassThrough -stream](https://nodejs.org/api/stream.html#stream_class_stream_passthrough) - -[It's very -fast](https://docs.google.com/spreadsheets/d/1K_HR5oh3r80b8WVMWCPPjfuWXUgfkmhlX7FGI6JJ8tY/edit?usp=sharing) -for objects, strings, and buffers. - -Supports `pipe()`ing (including multi-`pipe()` and backpressure -transmission), buffering data until either a `data` event handler -or `pipe()` is added (so you don't lose the first chunk), and -most other cases where PassThrough is a good idea. - -There is a `read()` method, but it's much more efficient to -consume data from this stream via `'data'` events or by calling -`pipe()` into some other stream. Calling `read()` requires the -buffer to be flattened in some cases, which requires copying -memory. - -If you set `objectMode: true` in the options, then whatever is -written will be emitted. Otherwise, it'll do a minimal amount of -Buffer copying to ensure proper Streams semantics when `read(n)` -is called. - -`objectMode` can also be set by doing `stream.objectMode = true`, -or by writing any non-string/non-buffer data. `objectMode` cannot -be set to false once it is set. - -This is not a `through` or `through2` stream. It doesn't -transform the data, it just passes it right through. If you want -to transform the data, extend the class, and override the -`write()` method. Once you're done transforming the data however -you want, call `super.write()` with the transform output. - -For some examples of streams that extend Minipass in various -ways, check out: - -- [minizlib](http://npm.im/minizlib) -- [fs-minipass](http://npm.im/fs-minipass) -- [tar](http://npm.im/tar) -- [minipass-collect](http://npm.im/minipass-collect) -- [minipass-flush](http://npm.im/minipass-flush) -- [minipass-pipeline](http://npm.im/minipass-pipeline) -- [tap](http://npm.im/tap) -- [tap-parser](http://npm.im/tap-parser) -- [treport](http://npm.im/treport) -- [minipass-fetch](http://npm.im/minipass-fetch) -- [pacote](http://npm.im/pacote) -- [make-fetch-happen](http://npm.im/make-fetch-happen) -- [cacache](http://npm.im/cacache) -- [ssri](http://npm.im/ssri) -- [npm-registry-fetch](http://npm.im/npm-registry-fetch) -- [minipass-json-stream](http://npm.im/minipass-json-stream) -- [minipass-sized](http://npm.im/minipass-sized) - -## Differences from Node.js Streams - -There are several things that make Minipass streams different -from (and in some ways superior to) Node.js core streams. - -Please read these caveats if you are familiar with node-core -streams and intend to use Minipass streams in your programs. - -You can avoid most of these differences entirely (for a very -small performance penalty) by setting `{async: true}` in the -constructor options. - -### Timing - -Minipass streams are designed to support synchronous use-cases. -Thus, data is emitted as soon as it is available, always. It is -buffered until read, but no longer. Another way to look at it is -that Minipass streams are exactly as synchronous as the logic -that writes into them. - -This can be surprising if your code relies on -`PassThrough.write()` always providing data on the next tick -rather than the current one, or being able to call `resume()` and -not have the entire buffer disappear immediately. - -However, without this synchronicity guarantee, there would be no -way for Minipass to achieve the speeds it does, or support the -synchronous use cases that it does. Simply put, waiting takes -time. - -This non-deferring approach makes Minipass streams much easier to -reason about, especially in the context of Promises and other -flow-control mechanisms. - -Example: - -```js -// hybrid module, either works -import Minipass from 'minipass' -// or: -const Minipass = require('minipass') - -const stream = new Minipass() -stream.on('data', () => console.log('data event')) -console.log('before write') -stream.write('hello') -console.log('after write') -// output: -// before write -// data event -// after write -``` - -### Exception: Async Opt-In - -If you wish to have a Minipass stream with behavior that more -closely mimics Node.js core streams, you can set the stream in -async mode either by setting `async: true` in the constructor -options, or by setting `stream.async = true` later on. - -```js -// hybrid module, either works -import Minipass from 'minipass' -// or: -const Minipass = require('minipass') - -const asyncStream = new Minipass({ async: true }) -asyncStream.on('data', () => console.log('data event')) -console.log('before write') -asyncStream.write('hello') -console.log('after write') -// output: -// before write -// after write -// data event <-- this is deferred until the next tick -``` - -Switching _out_ of async mode is unsafe, as it could cause data -corruption, and so is not enabled. Example: - -```js -import Minipass from 'minipass' -const stream = new Minipass({ encoding: 'utf8' }) -stream.on('data', chunk => console.log(chunk)) -stream.async = true -console.log('before writes') -stream.write('hello') -setStreamSyncAgainSomehow(stream) // <-- this doesn't actually exist! -stream.write('world') -console.log('after writes') -// hypothetical output would be: -// before writes -// world -// after writes -// hello -// NOT GOOD! -``` - -To avoid this problem, once set into async mode, any attempt to -make the stream sync again will be ignored. - -```js -const Minipass = require('minipass') -const stream = new Minipass({ encoding: 'utf8' }) -stream.on('data', chunk => console.log(chunk)) -stream.async = true -console.log('before writes') -stream.write('hello') -stream.async = false // <-- no-op, stream already async -stream.write('world') -console.log('after writes') -// actual output: -// before writes -// after writes -// hello -// world -``` - -### No High/Low Water Marks - -Node.js core streams will optimistically fill up a buffer, -returning `true` on all writes until the limit is hit, even if -the data has nowhere to go. Then, they will not attempt to draw -more data in until the buffer size dips below a minimum value. - -Minipass streams are much simpler. The `write()` method will -return `true` if the data has somewhere to go (which is to say, -given the timing guarantees, that the data is already there by -the time `write()` returns). - -If the data has nowhere to go, then `write()` returns false, and -the data sits in a buffer, to be drained out immediately as soon -as anyone consumes it. - -Since nothing is ever buffered unnecessarily, there is much less -copying data, and less bookkeeping about buffer capacity levels. - -### Hazards of Buffering (or: Why Minipass Is So Fast) - -Since data written to a Minipass stream is immediately written -all the way through the pipeline, and `write()` always returns -true/false based on whether the data was fully flushed, -backpressure is communicated immediately to the upstream caller. -This minimizes buffering. - -Consider this case: - -```js -const { PassThrough } = require('stream') -const p1 = new PassThrough({ highWaterMark: 1024 }) -const p2 = new PassThrough({ highWaterMark: 1024 }) -const p3 = new PassThrough({ highWaterMark: 1024 }) -const p4 = new PassThrough({ highWaterMark: 1024 }) - -p1.pipe(p2).pipe(p3).pipe(p4) -p4.on('data', () => console.log('made it through')) - -// this returns false and buffers, then writes to p2 on next tick (1) -// p2 returns false and buffers, pausing p1, then writes to p3 on next tick (2) -// p3 returns false and buffers, pausing p2, then writes to p4 on next tick (3) -// p4 returns false and buffers, pausing p3, then emits 'data' and 'drain' -// on next tick (4) -// p3 sees p4's 'drain' event, and calls resume(), emitting 'resume' and -// 'drain' on next tick (5) -// p2 sees p3's 'drain', calls resume(), emits 'resume' and 'drain' on next tick (6) -// p1 sees p2's 'drain', calls resume(), emits 'resume' and 'drain' on next -// tick (7) - -p1.write(Buffer.alloc(2048)) // returns false -``` - -Along the way, the data was buffered and deferred at each stage, -and multiple event deferrals happened, for an unblocked pipeline -where it was perfectly safe to write all the way through! - -Furthermore, setting a `highWaterMark` of `1024` might lead -someone reading the code to think an advisory maximum of 1KiB is -being set for the pipeline. However, the actual advisory -buffering level is the _sum_ of `highWaterMark` values, since -each one has its own bucket. - -Consider the Minipass case: - -```js -const m1 = new Minipass() -const m2 = new Minipass() -const m3 = new Minipass() -const m4 = new Minipass() - -m1.pipe(m2).pipe(m3).pipe(m4) -m4.on('data', () => console.log('made it through')) - -// m1 is flowing, so it writes the data to m2 immediately -// m2 is flowing, so it writes the data to m3 immediately -// m3 is flowing, so it writes the data to m4 immediately -// m4 is flowing, so it fires the 'data' event immediately, returns true -// m4's write returned true, so m3 is still flowing, returns true -// m3's write returned true, so m2 is still flowing, returns true -// m2's write returned true, so m1 is still flowing, returns true -// No event deferrals or buffering along the way! - -m1.write(Buffer.alloc(2048)) // returns true -``` - -It is extremely unlikely that you _don't_ want to buffer any data -written, or _ever_ buffer data that can be flushed all the way -through. Neither node-core streams nor Minipass ever fail to -buffer written data, but node-core streams do a lot of -unnecessary buffering and pausing. - -As always, the faster implementation is the one that does less -stuff and waits less time to do it. - -### Immediately emit `end` for empty streams (when not paused) - -If a stream is not paused, and `end()` is called before writing -any data into it, then it will emit `end` immediately. - -If you have logic that occurs on the `end` event which you don't -want to potentially happen immediately (for example, closing file -descriptors, moving on to the next entry in an archive parse -stream, etc.) then be sure to call `stream.pause()` on creation, -and then `stream.resume()` once you are ready to respond to the -`end` event. - -However, this is _usually_ not a problem because: - -### Emit `end` When Asked - -One hazard of immediately emitting `'end'` is that you may not -yet have had a chance to add a listener. In order to avoid this -hazard, Minipass streams safely re-emit the `'end'` event if a -new listener is added after `'end'` has been emitted. - -Ie, if you do `stream.on('end', someFunction)`, and the stream -has already emitted `end`, then it will call the handler right -away. (You can think of this somewhat like attaching a new -`.then(fn)` to a previously-resolved Promise.) - -To prevent calling handlers multiple times who would not expect -multiple ends to occur, all listeners are removed from the -`'end'` event whenever it is emitted. - -### Emit `error` When Asked - -The most recent error object passed to the `'error'` event is -stored on the stream. If a new `'error'` event handler is added, -and an error was previously emitted, then the event handler will -be called immediately (or on `process.nextTick` in the case of -async streams). - -This makes it much more difficult to end up trying to interact -with a broken stream, if the error handler is added after an -error was previously emitted. - -### Impact of "immediate flow" on Tee-streams - -A "tee stream" is a stream piping to multiple destinations: - -```js -const tee = new Minipass() -t.pipe(dest1) -t.pipe(dest2) -t.write('foo') // goes to both destinations -``` - -Since Minipass streams _immediately_ process any pending data -through the pipeline when a new pipe destination is added, this -can have surprising effects, especially when a stream comes in -from some other function and may or may not have data in its -buffer. - -```js -// WARNING! WILL LOSE DATA! -const src = new Minipass() -src.write('foo') -src.pipe(dest1) // 'foo' chunk flows to dest1 immediately, and is gone -src.pipe(dest2) // gets nothing! -``` - -One solution is to create a dedicated tee-stream junction that -pipes to both locations, and then pipe to _that_ instead. - -```js -// Safe example: tee to both places -const src = new Minipass() -src.write('foo') -const tee = new Minipass() -tee.pipe(dest1) -tee.pipe(dest2) -src.pipe(tee) // tee gets 'foo', pipes to both locations -``` - -The same caveat applies to `on('data')` event listeners. The -first one added will _immediately_ receive all of the data, -leaving nothing for the second: - -```js -// WARNING! WILL LOSE DATA! -const src = new Minipass() -src.write('foo') -src.on('data', handler1) // receives 'foo' right away -src.on('data', handler2) // nothing to see here! -``` - -Using a dedicated tee-stream can be used in this case as well: - -```js -// Safe example: tee to both data handlers -const src = new Minipass() -src.write('foo') -const tee = new Minipass() -tee.on('data', handler1) -tee.on('data', handler2) -src.pipe(tee) -``` - -All of the hazards in this section are avoided by setting `{ -async: true }` in the Minipass constructor, or by setting -`stream.async = true` afterwards. Note that this does add some -overhead, so should only be done in cases where you are willing -to lose a bit of performance in order to avoid having to refactor -program logic. - -## USAGE - -It's a stream! Use it like a stream and it'll most likely do what -you want. - -```js -import Minipass from 'minipass' -const mp = new Minipass(options) // optional: { encoding, objectMode } -mp.write('foo') -mp.pipe(someOtherStream) -mp.end('bar') -``` - -### OPTIONS - -- `encoding` How would you like the data coming _out_ of the - stream to be encoded? Accepts any values that can be passed to - `Buffer.toString()`. -- `objectMode` Emit data exactly as it comes in. This will be - flipped on by default if you write() something other than a - string or Buffer at any point. Setting `objectMode: true` will - prevent setting any encoding value. -- `async` Defaults to `false`. Set to `true` to defer data - emission until next tick. This reduces performance slightly, - but makes Minipass streams use timing behavior closer to Node - core streams. See [Timing](#timing) for more details. -- `signal` An `AbortSignal` that will cause the stream to unhook - itself from everything and become as inert as possible. Note - that providing a `signal` parameter will make `'error'` events - no longer throw if they are unhandled, but they will still be - emitted to handlers if any are attached. - -### API - -Implements the user-facing portions of Node.js's `Readable` and -`Writable` streams. - -### Methods - -- `write(chunk, [encoding], [callback])` - Put data in. (Note - that, in the base Minipass class, the same data will come out.) - Returns `false` if the stream will buffer the next write, or - true if it's still in "flowing" mode. -- `end([chunk, [encoding]], [callback])` - Signal that you have - no more data to write. This will queue an `end` event to be - fired when all the data has been consumed. -- `setEncoding(encoding)` - Set the encoding for data coming of - the stream. This can only be done once. -- `pause()` - No more data for a while, please. This also - prevents `end` from being emitted for empty streams until the - stream is resumed. -- `resume()` - Resume the stream. If there's data in the buffer, - it is all discarded. Any buffered events are immediately - emitted. -- `pipe(dest)` - Send all output to the stream provided. When - data is emitted, it is immediately written to any and all pipe - destinations. (Or written on next tick in `async` mode.) -- `unpipe(dest)` - Stop piping to the destination stream. This is - immediate, meaning that any asynchronously queued data will - _not_ make it to the destination when running in `async` mode. - - `options.end` - Boolean, end the destination stream when the - source stream ends. Default `true`. - - `options.proxyErrors` - Boolean, proxy `error` events from - the source stream to the destination stream. Note that errors - are _not_ proxied after the pipeline terminates, either due - to the source emitting `'end'` or manually unpiping with - `src.unpipe(dest)`. Default `false`. -- `on(ev, fn)`, `emit(ev, fn)` - Minipass streams are - EventEmitters. Some events are given special treatment, - however. (See below under "events".) -- `promise()` - Returns a Promise that resolves when the stream - emits `end`, or rejects if the stream emits `error`. -- `collect()` - Return a Promise that resolves on `end` with an - array containing each chunk of data that was emitted, or - rejects if the stream emits `error`. Note that this consumes - the stream data. -- `concat()` - Same as `collect()`, but concatenates the data - into a single Buffer object. Will reject the returned promise - if the stream is in objectMode, or if it goes into objectMode - by the end of the data. -- `read(n)` - Consume `n` bytes of data out of the buffer. If `n` - is not provided, then consume all of it. If `n` bytes are not - available, then it returns null. **Note** consuming streams in - this way is less efficient, and can lead to unnecessary Buffer - copying. -- `destroy([er])` - Destroy the stream. If an error is provided, - then an `'error'` event is emitted. If the stream has a - `close()` method, and has not emitted a `'close'` event yet, - then `stream.close()` will be called. Any Promises returned by - `.promise()`, `.collect()` or `.concat()` will be rejected. - After being destroyed, writing to the stream will emit an - error. No more data will be emitted if the stream is destroyed, - even if it was previously buffered. - -### Properties - -- `bufferLength` Read-only. Total number of bytes buffered, or in - the case of objectMode, the total number of objects. -- `encoding` The encoding that has been set. (Setting this is - equivalent to calling `setEncoding(enc)` and has the same - prohibition against setting multiple times.) -- `flowing` Read-only. Boolean indicating whether a chunk written - to the stream will be immediately emitted. -- `emittedEnd` Read-only. Boolean indicating whether the end-ish - events (ie, `end`, `prefinish`, `finish`) have been emitted. - Note that listening on any end-ish event will immediateyl - re-emit it if it has already been emitted. -- `writable` Whether the stream is writable. Default `true`. Set - to `false` when `end()` -- `readable` Whether the stream is readable. Default `true`. -- `pipes` An array of Pipe objects referencing streams that this - stream is piping into. -- `destroyed` A getter that indicates whether the stream was - destroyed. -- `paused` True if the stream has been explicitly paused, - otherwise false. -- `objectMode` Indicates whether the stream is in `objectMode`. - Once set to `true`, it cannot be set to `false`. -- `aborted` Readonly property set when the `AbortSignal` - dispatches an `abort` event. - -### Events - -- `data` Emitted when there's data to read. Argument is the data - to read. This is never emitted while not flowing. If a listener - is attached, that will resume the stream. -- `end` Emitted when there's no more data to read. This will be - emitted immediately for empty streams when `end()` is called. - If a listener is attached, and `end` was already emitted, then - it will be emitted again. All listeners are removed when `end` - is emitted. -- `prefinish` An end-ish event that follows the same logic as - `end` and is emitted in the same conditions where `end` is - emitted. Emitted after `'end'`. -- `finish` An end-ish event that follows the same logic as `end` - and is emitted in the same conditions where `end` is emitted. - Emitted after `'prefinish'`. -- `close` An indication that an underlying resource has been - released. Minipass does not emit this event, but will defer it - until after `end` has been emitted, since it throws off some - stream libraries otherwise. -- `drain` Emitted when the internal buffer empties, and it is - again suitable to `write()` into the stream. -- `readable` Emitted when data is buffered and ready to be read - by a consumer. -- `resume` Emitted when stream changes state from buffering to - flowing mode. (Ie, when `resume` is called, `pipe` is called, - or a `data` event listener is added.) - -### Static Methods - -- `Minipass.isStream(stream)` Returns `true` if the argument is a - stream, and false otherwise. To be considered a stream, the - object must be either an instance of Minipass, or an - EventEmitter that has either a `pipe()` method, or both - `write()` and `end()` methods. (Pretty much any stream in - node-land will return `true` for this.) - -## EXAMPLES - -Here are some examples of things you can do with Minipass -streams. - -### simple "are you done yet" promise - -```js -mp.promise().then( - () => { - // stream is finished - }, - er => { - // stream emitted an error - } -) -``` - -### collecting - -```js -mp.collect().then(all => { - // all is an array of all the data emitted - // encoding is supported in this case, so - // so the result will be a collection of strings if - // an encoding is specified, or buffers/objects if not. - // - // In an async function, you may do - // const data = await stream.collect() -}) -``` - -### collecting into a single blob - -This is a bit slower because it concatenates the data into one -chunk for you, but if you're going to do it yourself anyway, it's -convenient this way: - -```js -mp.concat().then(onebigchunk => { - // onebigchunk is a string if the stream - // had an encoding set, or a buffer otherwise. -}) -``` - -### iteration - -You can iterate over streams synchronously or asynchronously in -platforms that support it. - -Synchronous iteration will end when the currently available data -is consumed, even if the `end` event has not been reached. In -string and buffer mode, the data is concatenated, so unless -multiple writes are occurring in the same tick as the `read()`, -sync iteration loops will generally only have a single iteration. - -To consume chunks in this way exactly as they have been written, -with no flattening, create the stream with the `{ objectMode: -true }` option. - -```js -const mp = new Minipass({ objectMode: true }) -mp.write('a') -mp.write('b') -for (let letter of mp) { - console.log(letter) // a, b -} -mp.write('c') -mp.write('d') -for (let letter of mp) { - console.log(letter) // c, d -} -mp.write('e') -mp.end() -for (let letter of mp) { - console.log(letter) // e -} -for (let letter of mp) { - console.log(letter) // nothing -} -``` - -Asynchronous iteration will continue until the end event is reached, -consuming all of the data. - -```js -const mp = new Minipass({ encoding: 'utf8' }) - -// some source of some data -let i = 5 -const inter = setInterval(() => { - if (i-- > 0) mp.write(Buffer.from('foo\n', 'utf8')) - else { - mp.end() - clearInterval(inter) - } -}, 100) - -// consume the data with asynchronous iteration -async function consume() { - for await (let chunk of mp) { - console.log(chunk) - } - return 'ok' -} - -consume().then(res => console.log(res)) -// logs `foo\n` 5 times, and then `ok` -``` - -### subclass that `console.log()`s everything written into it - -```js -class Logger extends Minipass { - write(chunk, encoding, callback) { - console.log('WRITE', chunk, encoding) - return super.write(chunk, encoding, callback) - } - end(chunk, encoding, callback) { - console.log('END', chunk, encoding) - return super.end(chunk, encoding, callback) - } -} - -someSource.pipe(new Logger()).pipe(someDest) -``` - -### same thing, but using an inline anonymous class - -```js -// js classes are fun -someSource - .pipe( - new (class extends Minipass { - emit(ev, ...data) { - // let's also log events, because debugging some weird thing - console.log('EMIT', ev) - return super.emit(ev, ...data) - } - write(chunk, encoding, callback) { - console.log('WRITE', chunk, encoding) - return super.write(chunk, encoding, callback) - } - end(chunk, encoding, callback) { - console.log('END', chunk, encoding) - return super.end(chunk, encoding, callback) - } - })() - ) - .pipe(someDest) -``` - -### subclass that defers 'end' for some reason - -```js -class SlowEnd extends Minipass { - emit(ev, ...args) { - if (ev === 'end') { - console.log('going to end, hold on a sec') - setTimeout(() => { - console.log('ok, ready to end now') - super.emit('end', ...args) - }, 100) - } else { - return super.emit(ev, ...args) - } - } -} -``` - -### transform that creates newline-delimited JSON - -```js -class NDJSONEncode extends Minipass { - write(obj, cb) { - try { - // JSON.stringify can throw, emit an error on that - return super.write(JSON.stringify(obj) + '\n', 'utf8', cb) - } catch (er) { - this.emit('error', er) - } - } - end(obj, cb) { - if (typeof obj === 'function') { - cb = obj - obj = undefined - } - if (obj !== undefined) { - this.write(obj) - } - return super.end(cb) - } -} -``` - -### transform that parses newline-delimited JSON - -```js -class NDJSONDecode extends Minipass { - constructor (options) { - // always be in object mode, as far as Minipass is concerned - super({ objectMode: true }) - this._jsonBuffer = '' - } - write (chunk, encoding, cb) { - if (typeof chunk === 'string' && - typeof encoding === 'string' && - encoding !== 'utf8') { - chunk = Buffer.from(chunk, encoding).toString() - } else if (Buffer.isBuffer(chunk)) { - chunk = chunk.toString() - } - if (typeof encoding === 'function') { - cb = encoding - } - const jsonData = (this._jsonBuffer + chunk).split('\n') - this._jsonBuffer = jsonData.pop() - for (let i = 0; i < jsonData.length; i++) { - try { - // JSON.parse can throw, emit an error on that - super.write(JSON.parse(jsonData[i])) - } catch (er) { - this.emit('error', er) - continue - } - } - if (cb) - cb() - } -} -``` diff --git a/node_modules/minipass/index.d.ts b/node_modules/minipass/index.d.ts deleted file mode 100644 index 539fbca570..0000000000 --- a/node_modules/minipass/index.d.ts +++ /dev/null @@ -1,150 +0,0 @@ -/// - -// Note: marking anything protected or private in the exported -// class will limit Minipass's ability to be used as the base -// for mixin classes. -import { EventEmitter } from 'events' -import { Stream } from 'stream' - -declare namespace Minipass { - type Encoding = BufferEncoding | 'buffer' | null - - interface Writable extends EventEmitter { - end(): any - write(chunk: any, ...args: any[]): any - } - - interface Readable extends EventEmitter { - pause(): any - resume(): any - pipe(): any - } - - type DualIterable = Iterable & AsyncIterable - - type ContiguousData = Buffer | ArrayBufferLike | ArrayBufferView | string - - type BufferOrString = Buffer | string - - interface SharedOptions { - async?: boolean - signal?: AbortSignal - } - - interface StringOptions extends SharedOptions { - encoding: BufferEncoding - objectMode?: boolean - } - - interface BufferOptions extends SharedOptions { - encoding?: null | 'buffer' - objectMode?: boolean - } - - interface ObjectModeOptions extends SharedOptions { - objectMode: true - } - - interface PipeOptions { - end?: boolean - proxyErrors?: boolean - } - - type Options = T extends string - ? StringOptions - : T extends Buffer - ? BufferOptions - : ObjectModeOptions -} - -declare class Minipass< - RType extends any = Buffer, - WType extends any = RType extends Minipass.BufferOrString - ? Minipass.ContiguousData - : RType - > - extends Stream - implements Minipass.DualIterable -{ - static isStream(stream: any): stream is Minipass.Readable | Minipass.Writable - - readonly bufferLength: number - readonly flowing: boolean - readonly writable: boolean - readonly readable: boolean - readonly aborted: boolean - readonly paused: boolean - readonly emittedEnd: boolean - readonly destroyed: boolean - - /** - * Technically writable, but mutating it can change the type, - * so is not safe to do in TypeScript. - */ - readonly objectMode: boolean - async: boolean - - /** - * Note: encoding is not actually read-only, and setEncoding(enc) - * exists. However, this type definition will insist that TypeScript - * programs declare the type of a Minipass stream up front, and if - * that type is string, then an encoding MUST be set in the ctor. If - * the type is Buffer, then the encoding must be missing, or set to - * 'buffer' or null. If the type is anything else, then objectMode - * must be set in the constructor options. So there is effectively - * no allowed way that a TS program can set the encoding after - * construction, as doing so will destroy any hope of type safety. - * TypeScript does not provide many options for changing the type of - * an object at run-time, which is what changing the encoding does. - */ - readonly encoding: Minipass.Encoding - // setEncoding(encoding: Encoding): void - - // Options required if not reading buffers - constructor( - ...args: RType extends Buffer - ? [] | [Minipass.Options] - : [Minipass.Options] - ) - - write(chunk: WType, cb?: () => void): boolean - write(chunk: WType, encoding?: Minipass.Encoding, cb?: () => void): boolean - read(size?: number): RType - end(cb?: () => void): this - end(chunk: any, cb?: () => void): this - end(chunk: any, encoding?: Minipass.Encoding, cb?: () => void): this - pause(): void - resume(): void - promise(): Promise - collect(): Promise - - concat(): RType extends Minipass.BufferOrString ? Promise : never - destroy(er?: any): void - pipe(dest: W, opts?: Minipass.PipeOptions): W - unpipe(dest: W): void - - /** - * alias for on() - */ - addEventHandler(event: string, listener: (...args: any[]) => any): this - - on(event: string, listener: (...args: any[]) => any): this - on(event: 'data', listener: (chunk: RType) => any): this - on(event: 'error', listener: (error: any) => any): this - on( - event: - | 'readable' - | 'drain' - | 'resume' - | 'end' - | 'prefinish' - | 'finish' - | 'close', - listener: () => any - ): this - - [Symbol.iterator](): Generator - [Symbol.asyncIterator](): AsyncGenerator -} - -export = Minipass diff --git a/node_modules/minipass/index.js b/node_modules/minipass/index.js deleted file mode 100644 index 97b23068c9..0000000000 --- a/node_modules/minipass/index.js +++ /dev/null @@ -1,697 +0,0 @@ -'use strict' -const proc = - typeof process === 'object' && process - ? process - : { - stdout: null, - stderr: null, - } -const EE = require('events') -const Stream = require('stream') -const stringdecoder = require('string_decoder') -const SD = stringdecoder.StringDecoder - -const EOF = Symbol('EOF') -const MAYBE_EMIT_END = Symbol('maybeEmitEnd') -const EMITTED_END = Symbol('emittedEnd') -const EMITTING_END = Symbol('emittingEnd') -const EMITTED_ERROR = Symbol('emittedError') -const CLOSED = Symbol('closed') -const READ = Symbol('read') -const FLUSH = Symbol('flush') -const FLUSHCHUNK = Symbol('flushChunk') -const ENCODING = Symbol('encoding') -const DECODER = Symbol('decoder') -const FLOWING = Symbol('flowing') -const PAUSED = Symbol('paused') -const RESUME = Symbol('resume') -const BUFFER = Symbol('buffer') -const PIPES = Symbol('pipes') -const BUFFERLENGTH = Symbol('bufferLength') -const BUFFERPUSH = Symbol('bufferPush') -const BUFFERSHIFT = Symbol('bufferShift') -const OBJECTMODE = Symbol('objectMode') -// internal event when stream is destroyed -const DESTROYED = Symbol('destroyed') -// internal event when stream has an error -const ERROR = Symbol('error') -const EMITDATA = Symbol('emitData') -const EMITEND = Symbol('emitEnd') -const EMITEND2 = Symbol('emitEnd2') -const ASYNC = Symbol('async') -const ABORT = Symbol('abort') -const ABORTED = Symbol('aborted') -const SIGNAL = Symbol('signal') - -const defer = fn => Promise.resolve().then(fn) - -// TODO remove when Node v8 support drops -const doIter = global._MP_NO_ITERATOR_SYMBOLS_ !== '1' -const ASYNCITERATOR = - (doIter && Symbol.asyncIterator) || Symbol('asyncIterator not implemented') -const ITERATOR = - (doIter && Symbol.iterator) || Symbol('iterator not implemented') - -// events that mean 'the stream is over' -// these are treated specially, and re-emitted -// if they are listened for after emitting. -const isEndish = ev => ev === 'end' || ev === 'finish' || ev === 'prefinish' - -const isArrayBuffer = b => - b instanceof ArrayBuffer || - (typeof b === 'object' && - b.constructor && - b.constructor.name === 'ArrayBuffer' && - b.byteLength >= 0) - -const isArrayBufferView = b => !Buffer.isBuffer(b) && ArrayBuffer.isView(b) - -class Pipe { - constructor(src, dest, opts) { - this.src = src - this.dest = dest - this.opts = opts - this.ondrain = () => src[RESUME]() - dest.on('drain', this.ondrain) - } - unpipe() { - this.dest.removeListener('drain', this.ondrain) - } - // istanbul ignore next - only here for the prototype - proxyErrors() {} - end() { - this.unpipe() - if (this.opts.end) this.dest.end() - } -} - -class PipeProxyErrors extends Pipe { - unpipe() { - this.src.removeListener('error', this.proxyErrors) - super.unpipe() - } - constructor(src, dest, opts) { - super(src, dest, opts) - this.proxyErrors = er => dest.emit('error', er) - src.on('error', this.proxyErrors) - } -} - -class Minipass extends Stream { - constructor(options) { - super() - this[FLOWING] = false - // whether we're explicitly paused - this[PAUSED] = false - this[PIPES] = [] - this[BUFFER] = [] - this[OBJECTMODE] = (options && options.objectMode) || false - if (this[OBJECTMODE]) this[ENCODING] = null - else this[ENCODING] = (options && options.encoding) || null - if (this[ENCODING] === 'buffer') this[ENCODING] = null - this[ASYNC] = (options && !!options.async) || false - this[DECODER] = this[ENCODING] ? new SD(this[ENCODING]) : null - this[EOF] = false - this[EMITTED_END] = false - this[EMITTING_END] = false - this[CLOSED] = false - this[EMITTED_ERROR] = null - this.writable = true - this.readable = true - this[BUFFERLENGTH] = 0 - this[DESTROYED] = false - if (options && options.debugExposeBuffer === true) { - Object.defineProperty(this, 'buffer', { get: () => this[BUFFER] }) - } - if (options && options.debugExposePipes === true) { - Object.defineProperty(this, 'pipes', { get: () => this[PIPES] }) - } - this[SIGNAL] = options && options.signal - this[ABORTED] = false - if (this[SIGNAL]) { - this[SIGNAL].addEventListener('abort', () => this[ABORT]()) - if (this[SIGNAL].aborted) { - this[ABORT]() - } - } - } - - get bufferLength() { - return this[BUFFERLENGTH] - } - - get encoding() { - return this[ENCODING] - } - set encoding(enc) { - if (this[OBJECTMODE]) throw new Error('cannot set encoding in objectMode') - - if ( - this[ENCODING] && - enc !== this[ENCODING] && - ((this[DECODER] && this[DECODER].lastNeed) || this[BUFFERLENGTH]) - ) - throw new Error('cannot change encoding') - - if (this[ENCODING] !== enc) { - this[DECODER] = enc ? new SD(enc) : null - if (this[BUFFER].length) - this[BUFFER] = this[BUFFER].map(chunk => this[DECODER].write(chunk)) - } - - this[ENCODING] = enc - } - - setEncoding(enc) { - this.encoding = enc - } - - get objectMode() { - return this[OBJECTMODE] - } - set objectMode(om) { - this[OBJECTMODE] = this[OBJECTMODE] || !!om - } - - get ['async']() { - return this[ASYNC] - } - set ['async'](a) { - this[ASYNC] = this[ASYNC] || !!a - } - - // drop everything and get out of the flow completely - [ABORT]() { - this[ABORTED] = true - this.emit('abort', this[SIGNAL].reason) - this.destroy(this[SIGNAL].reason) - } - - get aborted() { - return this[ABORTED] - } - set aborted(_) {} - - write(chunk, encoding, cb) { - if (this[ABORTED]) return false - if (this[EOF]) throw new Error('write after end') - - if (this[DESTROYED]) { - this.emit( - 'error', - Object.assign( - new Error('Cannot call write after a stream was destroyed'), - { code: 'ERR_STREAM_DESTROYED' } - ) - ) - return true - } - - if (typeof encoding === 'function') (cb = encoding), (encoding = 'utf8') - - if (!encoding) encoding = 'utf8' - - const fn = this[ASYNC] ? defer : f => f() - - // convert array buffers and typed array views into buffers - // at some point in the future, we may want to do the opposite! - // leave strings and buffers as-is - // anything else switches us into object mode - if (!this[OBJECTMODE] && !Buffer.isBuffer(chunk)) { - if (isArrayBufferView(chunk)) - chunk = Buffer.from(chunk.buffer, chunk.byteOffset, chunk.byteLength) - else if (isArrayBuffer(chunk)) chunk = Buffer.from(chunk) - else if (typeof chunk !== 'string') - // use the setter so we throw if we have encoding set - this.objectMode = true - } - - // handle object mode up front, since it's simpler - // this yields better performance, fewer checks later. - if (this[OBJECTMODE]) { - /* istanbul ignore if - maybe impossible? */ - if (this.flowing && this[BUFFERLENGTH] !== 0) this[FLUSH](true) - - if (this.flowing) this.emit('data', chunk) - else this[BUFFERPUSH](chunk) - - if (this[BUFFERLENGTH] !== 0) this.emit('readable') - - if (cb) fn(cb) - - return this.flowing - } - - // at this point the chunk is a buffer or string - // don't buffer it up or send it to the decoder - if (!chunk.length) { - if (this[BUFFERLENGTH] !== 0) this.emit('readable') - if (cb) fn(cb) - return this.flowing - } - - // fast-path writing strings of same encoding to a stream with - // an empty buffer, skipping the buffer/decoder dance - if ( - typeof chunk === 'string' && - // unless it is a string already ready for us to use - !(encoding === this[ENCODING] && !this[DECODER].lastNeed) - ) { - chunk = Buffer.from(chunk, encoding) - } - - if (Buffer.isBuffer(chunk) && this[ENCODING]) - chunk = this[DECODER].write(chunk) - - // Note: flushing CAN potentially switch us into not-flowing mode - if (this.flowing && this[BUFFERLENGTH] !== 0) this[FLUSH](true) - - if (this.flowing) this.emit('data', chunk) - else this[BUFFERPUSH](chunk) - - if (this[BUFFERLENGTH] !== 0) this.emit('readable') - - if (cb) fn(cb) - - return this.flowing - } - - read(n) { - if (this[DESTROYED]) return null - - if (this[BUFFERLENGTH] === 0 || n === 0 || n > this[BUFFERLENGTH]) { - this[MAYBE_EMIT_END]() - return null - } - - if (this[OBJECTMODE]) n = null - - if (this[BUFFER].length > 1 && !this[OBJECTMODE]) { - if (this.encoding) this[BUFFER] = [this[BUFFER].join('')] - else this[BUFFER] = [Buffer.concat(this[BUFFER], this[BUFFERLENGTH])] - } - - const ret = this[READ](n || null, this[BUFFER][0]) - this[MAYBE_EMIT_END]() - return ret - } - - [READ](n, chunk) { - if (n === chunk.length || n === null) this[BUFFERSHIFT]() - else { - this[BUFFER][0] = chunk.slice(n) - chunk = chunk.slice(0, n) - this[BUFFERLENGTH] -= n - } - - this.emit('data', chunk) - - if (!this[BUFFER].length && !this[EOF]) this.emit('drain') - - return chunk - } - - end(chunk, encoding, cb) { - if (typeof chunk === 'function') (cb = chunk), (chunk = null) - if (typeof encoding === 'function') (cb = encoding), (encoding = 'utf8') - if (chunk) this.write(chunk, encoding) - if (cb) this.once('end', cb) - this[EOF] = true - this.writable = false - - // if we haven't written anything, then go ahead and emit, - // even if we're not reading. - // we'll re-emit if a new 'end' listener is added anyway. - // This makes MP more suitable to write-only use cases. - if (this.flowing || !this[PAUSED]) this[MAYBE_EMIT_END]() - return this - } - - // don't let the internal resume be overwritten - [RESUME]() { - if (this[DESTROYED]) return - - this[PAUSED] = false - this[FLOWING] = true - this.emit('resume') - if (this[BUFFER].length) this[FLUSH]() - else if (this[EOF]) this[MAYBE_EMIT_END]() - else this.emit('drain') - } - - resume() { - return this[RESUME]() - } - - pause() { - this[FLOWING] = false - this[PAUSED] = true - } - - get destroyed() { - return this[DESTROYED] - } - - get flowing() { - return this[FLOWING] - } - - get paused() { - return this[PAUSED] - } - - [BUFFERPUSH](chunk) { - if (this[OBJECTMODE]) this[BUFFERLENGTH] += 1 - else this[BUFFERLENGTH] += chunk.length - this[BUFFER].push(chunk) - } - - [BUFFERSHIFT]() { - if (this[OBJECTMODE]) this[BUFFERLENGTH] -= 1 - else this[BUFFERLENGTH] -= this[BUFFER][0].length - return this[BUFFER].shift() - } - - [FLUSH](noDrain) { - do {} while (this[FLUSHCHUNK](this[BUFFERSHIFT]()) && this[BUFFER].length) - - if (!noDrain && !this[BUFFER].length && !this[EOF]) this.emit('drain') - } - - [FLUSHCHUNK](chunk) { - this.emit('data', chunk) - return this.flowing - } - - pipe(dest, opts) { - if (this[DESTROYED]) return - - const ended = this[EMITTED_END] - opts = opts || {} - if (dest === proc.stdout || dest === proc.stderr) opts.end = false - else opts.end = opts.end !== false - opts.proxyErrors = !!opts.proxyErrors - - // piping an ended stream ends immediately - if (ended) { - if (opts.end) dest.end() - } else { - this[PIPES].push( - !opts.proxyErrors - ? new Pipe(this, dest, opts) - : new PipeProxyErrors(this, dest, opts) - ) - if (this[ASYNC]) defer(() => this[RESUME]()) - else this[RESUME]() - } - - return dest - } - - unpipe(dest) { - const p = this[PIPES].find(p => p.dest === dest) - if (p) { - this[PIPES].splice(this[PIPES].indexOf(p), 1) - p.unpipe() - } - } - - addListener(ev, fn) { - return this.on(ev, fn) - } - - on(ev, fn) { - const ret = super.on(ev, fn) - if (ev === 'data' && !this[PIPES].length && !this.flowing) this[RESUME]() - else if (ev === 'readable' && this[BUFFERLENGTH] !== 0) - super.emit('readable') - else if (isEndish(ev) && this[EMITTED_END]) { - super.emit(ev) - this.removeAllListeners(ev) - } else if (ev === 'error' && this[EMITTED_ERROR]) { - if (this[ASYNC]) defer(() => fn.call(this, this[EMITTED_ERROR])) - else fn.call(this, this[EMITTED_ERROR]) - } - return ret - } - - get emittedEnd() { - return this[EMITTED_END] - } - - [MAYBE_EMIT_END]() { - if ( - !this[EMITTING_END] && - !this[EMITTED_END] && - !this[DESTROYED] && - this[BUFFER].length === 0 && - this[EOF] - ) { - this[EMITTING_END] = true - this.emit('end') - this.emit('prefinish') - this.emit('finish') - if (this[CLOSED]) this.emit('close') - this[EMITTING_END] = false - } - } - - emit(ev, data, ...extra) { - // error and close are only events allowed after calling destroy() - if (ev !== 'error' && ev !== 'close' && ev !== DESTROYED && this[DESTROYED]) - return - else if (ev === 'data') { - return !this[OBJECTMODE] && !data - ? false - : this[ASYNC] - ? defer(() => this[EMITDATA](data)) - : this[EMITDATA](data) - } else if (ev === 'end') { - return this[EMITEND]() - } else if (ev === 'close') { - this[CLOSED] = true - // don't emit close before 'end' and 'finish' - if (!this[EMITTED_END] && !this[DESTROYED]) return - const ret = super.emit('close') - this.removeAllListeners('close') - return ret - } else if (ev === 'error') { - this[EMITTED_ERROR] = data - super.emit(ERROR, data) - const ret = - !this[SIGNAL] || this.listeners('error').length - ? super.emit('error', data) - : false - this[MAYBE_EMIT_END]() - return ret - } else if (ev === 'resume') { - const ret = super.emit('resume') - this[MAYBE_EMIT_END]() - return ret - } else if (ev === 'finish' || ev === 'prefinish') { - const ret = super.emit(ev) - this.removeAllListeners(ev) - return ret - } - - // Some other unknown event - const ret = super.emit(ev, data, ...extra) - this[MAYBE_EMIT_END]() - return ret - } - - [EMITDATA](data) { - for (const p of this[PIPES]) { - if (p.dest.write(data) === false) this.pause() - } - const ret = super.emit('data', data) - this[MAYBE_EMIT_END]() - return ret - } - - [EMITEND]() { - if (this[EMITTED_END]) return - - this[EMITTED_END] = true - this.readable = false - if (this[ASYNC]) defer(() => this[EMITEND2]()) - else this[EMITEND2]() - } - - [EMITEND2]() { - if (this[DECODER]) { - const data = this[DECODER].end() - if (data) { - for (const p of this[PIPES]) { - p.dest.write(data) - } - super.emit('data', data) - } - } - - for (const p of this[PIPES]) { - p.end() - } - const ret = super.emit('end') - this.removeAllListeners('end') - return ret - } - - // const all = await stream.collect() - collect() { - const buf = [] - if (!this[OBJECTMODE]) buf.dataLength = 0 - // set the promise first, in case an error is raised - // by triggering the flow here. - const p = this.promise() - this.on('data', c => { - buf.push(c) - if (!this[OBJECTMODE]) buf.dataLength += c.length - }) - return p.then(() => buf) - } - - // const data = await stream.concat() - concat() { - return this[OBJECTMODE] - ? Promise.reject(new Error('cannot concat in objectMode')) - : this.collect().then(buf => - this[OBJECTMODE] - ? Promise.reject(new Error('cannot concat in objectMode')) - : this[ENCODING] - ? buf.join('') - : Buffer.concat(buf, buf.dataLength) - ) - } - - // stream.promise().then(() => done, er => emitted error) - promise() { - return new Promise((resolve, reject) => { - this.on(DESTROYED, () => reject(new Error('stream destroyed'))) - this.on('error', er => reject(er)) - this.on('end', () => resolve()) - }) - } - - // for await (let chunk of stream) - [ASYNCITERATOR]() { - let stopped = false - const stop = () => { - this.pause() - stopped = true - return Promise.resolve({ done: true }) - } - const next = () => { - if (stopped) return stop() - const res = this.read() - if (res !== null) return Promise.resolve({ done: false, value: res }) - - if (this[EOF]) return stop() - - let resolve = null - let reject = null - const onerr = er => { - this.removeListener('data', ondata) - this.removeListener('end', onend) - stop() - reject(er) - } - const ondata = value => { - this.removeListener('error', onerr) - this.removeListener('end', onend) - this.pause() - resolve({ value: value, done: !!this[EOF] }) - } - const onend = () => { - this.removeListener('error', onerr) - this.removeListener('data', ondata) - stop() - resolve({ done: true }) - } - const ondestroy = () => onerr(new Error('stream destroyed')) - return new Promise((res, rej) => { - reject = rej - resolve = res - this.once(DESTROYED, ondestroy) - this.once('error', onerr) - this.once('end', onend) - this.once('data', ondata) - }) - } - - return { - next, - throw: stop, - return: stop, - [ASYNCITERATOR]() { - return this - }, - } - } - - // for (let chunk of stream) - [ITERATOR]() { - let stopped = false - const stop = () => { - this.pause() - this.removeListener(ERROR, stop) - this.removeListener('end', stop) - stopped = true - return { done: true } - } - - const next = () => { - if (stopped) return stop() - const value = this.read() - return value === null ? stop() : { value } - } - this.once('end', stop) - this.once(ERROR, stop) - - return { - next, - throw: stop, - return: stop, - [ITERATOR]() { - return this - }, - } - } - - destroy(er) { - if (this[DESTROYED]) { - if (er) this.emit('error', er) - else this.emit(DESTROYED) - return this - } - - this[DESTROYED] = true - - // throw away all buffered data, it's never coming out - this[BUFFER].length = 0 - this[BUFFERLENGTH] = 0 - - if (typeof this.close === 'function' && !this[CLOSED]) this.close() - - if (er) this.emit('error', er) - // if no error to emit, still reject pending promises - else this.emit(DESTROYED) - - return this - } - - static isStream(s) { - return ( - !!s && - (s instanceof Minipass || - s instanceof Stream || - (s instanceof EE && - // readable - (typeof s.pipe === 'function' || - // writable - (typeof s.write === 'function' && typeof s.end === 'function')))) - ) - } -} - -module.exports = Minipass diff --git a/node_modules/minipass/index.mjs b/node_modules/minipass/index.mjs deleted file mode 100644 index a669403664..0000000000 --- a/node_modules/minipass/index.mjs +++ /dev/null @@ -1,697 +0,0 @@ -'use strict' -const proc = - typeof process === 'object' && process - ? process - : { - stdout: null, - stderr: null, - } -import EE from 'events' -import Stream from 'stream' -import stringdecoder from 'string_decoder' -const SD = stringdecoder.StringDecoder - -const EOF = Symbol('EOF') -const MAYBE_EMIT_END = Symbol('maybeEmitEnd') -const EMITTED_END = Symbol('emittedEnd') -const EMITTING_END = Symbol('emittingEnd') -const EMITTED_ERROR = Symbol('emittedError') -const CLOSED = Symbol('closed') -const READ = Symbol('read') -const FLUSH = Symbol('flush') -const FLUSHCHUNK = Symbol('flushChunk') -const ENCODING = Symbol('encoding') -const DECODER = Symbol('decoder') -const FLOWING = Symbol('flowing') -const PAUSED = Symbol('paused') -const RESUME = Symbol('resume') -const BUFFER = Symbol('buffer') -const PIPES = Symbol('pipes') -const BUFFERLENGTH = Symbol('bufferLength') -const BUFFERPUSH = Symbol('bufferPush') -const BUFFERSHIFT = Symbol('bufferShift') -const OBJECTMODE = Symbol('objectMode') -// internal event when stream is destroyed -const DESTROYED = Symbol('destroyed') -// internal event when stream has an error -const ERROR = Symbol('error') -const EMITDATA = Symbol('emitData') -const EMITEND = Symbol('emitEnd') -const EMITEND2 = Symbol('emitEnd2') -const ASYNC = Symbol('async') -const ABORT = Symbol('abort') -const ABORTED = Symbol('aborted') -const SIGNAL = Symbol('signal') - -const defer = fn => Promise.resolve().then(fn) - -// TODO remove when Node v8 support drops -const doIter = global._MP_NO_ITERATOR_SYMBOLS_ !== '1' -const ASYNCITERATOR = - (doIter && Symbol.asyncIterator) || Symbol('asyncIterator not implemented') -const ITERATOR = - (doIter && Symbol.iterator) || Symbol('iterator not implemented') - -// events that mean 'the stream is over' -// these are treated specially, and re-emitted -// if they are listened for after emitting. -const isEndish = ev => ev === 'end' || ev === 'finish' || ev === 'prefinish' - -const isArrayBuffer = b => - b instanceof ArrayBuffer || - (typeof b === 'object' && - b.constructor && - b.constructor.name === 'ArrayBuffer' && - b.byteLength >= 0) - -const isArrayBufferView = b => !Buffer.isBuffer(b) && ArrayBuffer.isView(b) - -class Pipe { - constructor(src, dest, opts) { - this.src = src - this.dest = dest - this.opts = opts - this.ondrain = () => src[RESUME]() - dest.on('drain', this.ondrain) - } - unpipe() { - this.dest.removeListener('drain', this.ondrain) - } - // istanbul ignore next - only here for the prototype - proxyErrors() {} - end() { - this.unpipe() - if (this.opts.end) this.dest.end() - } -} - -class PipeProxyErrors extends Pipe { - unpipe() { - this.src.removeListener('error', this.proxyErrors) - super.unpipe() - } - constructor(src, dest, opts) { - super(src, dest, opts) - this.proxyErrors = er => dest.emit('error', er) - src.on('error', this.proxyErrors) - } -} - -class Minipass extends Stream { - constructor(options) { - super() - this[FLOWING] = false - // whether we're explicitly paused - this[PAUSED] = false - this[PIPES] = [] - this[BUFFER] = [] - this[OBJECTMODE] = (options && options.objectMode) || false - if (this[OBJECTMODE]) this[ENCODING] = null - else this[ENCODING] = (options && options.encoding) || null - if (this[ENCODING] === 'buffer') this[ENCODING] = null - this[ASYNC] = (options && !!options.async) || false - this[DECODER] = this[ENCODING] ? new SD(this[ENCODING]) : null - this[EOF] = false - this[EMITTED_END] = false - this[EMITTING_END] = false - this[CLOSED] = false - this[EMITTED_ERROR] = null - this.writable = true - this.readable = true - this[BUFFERLENGTH] = 0 - this[DESTROYED] = false - if (options && options.debugExposeBuffer === true) { - Object.defineProperty(this, 'buffer', { get: () => this[BUFFER] }) - } - if (options && options.debugExposePipes === true) { - Object.defineProperty(this, 'pipes', { get: () => this[PIPES] }) - } - this[SIGNAL] = options && options.signal - this[ABORTED] = false - if (this[SIGNAL]) { - this[SIGNAL].addEventListener('abort', () => this[ABORT]()) - if (this[SIGNAL].aborted) { - this[ABORT]() - } - } - } - - get bufferLength() { - return this[BUFFERLENGTH] - } - - get encoding() { - return this[ENCODING] - } - set encoding(enc) { - if (this[OBJECTMODE]) throw new Error('cannot set encoding in objectMode') - - if ( - this[ENCODING] && - enc !== this[ENCODING] && - ((this[DECODER] && this[DECODER].lastNeed) || this[BUFFERLENGTH]) - ) - throw new Error('cannot change encoding') - - if (this[ENCODING] !== enc) { - this[DECODER] = enc ? new SD(enc) : null - if (this[BUFFER].length) - this[BUFFER] = this[BUFFER].map(chunk => this[DECODER].write(chunk)) - } - - this[ENCODING] = enc - } - - setEncoding(enc) { - this.encoding = enc - } - - get objectMode() { - return this[OBJECTMODE] - } - set objectMode(om) { - this[OBJECTMODE] = this[OBJECTMODE] || !!om - } - - get ['async']() { - return this[ASYNC] - } - set ['async'](a) { - this[ASYNC] = this[ASYNC] || !!a - } - - // drop everything and get out of the flow completely - [ABORT]() { - this[ABORTED] = true - this.emit('abort', this[SIGNAL].reason) - this.destroy(this[SIGNAL].reason) - } - - get aborted() { - return this[ABORTED] - } - set aborted(_) {} - - write(chunk, encoding, cb) { - if (this[ABORTED]) return false - if (this[EOF]) throw new Error('write after end') - - if (this[DESTROYED]) { - this.emit( - 'error', - Object.assign( - new Error('Cannot call write after a stream was destroyed'), - { code: 'ERR_STREAM_DESTROYED' } - ) - ) - return true - } - - if (typeof encoding === 'function') (cb = encoding), (encoding = 'utf8') - - if (!encoding) encoding = 'utf8' - - const fn = this[ASYNC] ? defer : f => f() - - // convert array buffers and typed array views into buffers - // at some point in the future, we may want to do the opposite! - // leave strings and buffers as-is - // anything else switches us into object mode - if (!this[OBJECTMODE] && !Buffer.isBuffer(chunk)) { - if (isArrayBufferView(chunk)) - chunk = Buffer.from(chunk.buffer, chunk.byteOffset, chunk.byteLength) - else if (isArrayBuffer(chunk)) chunk = Buffer.from(chunk) - else if (typeof chunk !== 'string') - // use the setter so we throw if we have encoding set - this.objectMode = true - } - - // handle object mode up front, since it's simpler - // this yields better performance, fewer checks later. - if (this[OBJECTMODE]) { - /* istanbul ignore if - maybe impossible? */ - if (this.flowing && this[BUFFERLENGTH] !== 0) this[FLUSH](true) - - if (this.flowing) this.emit('data', chunk) - else this[BUFFERPUSH](chunk) - - if (this[BUFFERLENGTH] !== 0) this.emit('readable') - - if (cb) fn(cb) - - return this.flowing - } - - // at this point the chunk is a buffer or string - // don't buffer it up or send it to the decoder - if (!chunk.length) { - if (this[BUFFERLENGTH] !== 0) this.emit('readable') - if (cb) fn(cb) - return this.flowing - } - - // fast-path writing strings of same encoding to a stream with - // an empty buffer, skipping the buffer/decoder dance - if ( - typeof chunk === 'string' && - // unless it is a string already ready for us to use - !(encoding === this[ENCODING] && !this[DECODER].lastNeed) - ) { - chunk = Buffer.from(chunk, encoding) - } - - if (Buffer.isBuffer(chunk) && this[ENCODING]) - chunk = this[DECODER].write(chunk) - - // Note: flushing CAN potentially switch us into not-flowing mode - if (this.flowing && this[BUFFERLENGTH] !== 0) this[FLUSH](true) - - if (this.flowing) this.emit('data', chunk) - else this[BUFFERPUSH](chunk) - - if (this[BUFFERLENGTH] !== 0) this.emit('readable') - - if (cb) fn(cb) - - return this.flowing - } - - read(n) { - if (this[DESTROYED]) return null - - if (this[BUFFERLENGTH] === 0 || n === 0 || n > this[BUFFERLENGTH]) { - this[MAYBE_EMIT_END]() - return null - } - - if (this[OBJECTMODE]) n = null - - if (this[BUFFER].length > 1 && !this[OBJECTMODE]) { - if (this.encoding) this[BUFFER] = [this[BUFFER].join('')] - else this[BUFFER] = [Buffer.concat(this[BUFFER], this[BUFFERLENGTH])] - } - - const ret = this[READ](n || null, this[BUFFER][0]) - this[MAYBE_EMIT_END]() - return ret - } - - [READ](n, chunk) { - if (n === chunk.length || n === null) this[BUFFERSHIFT]() - else { - this[BUFFER][0] = chunk.slice(n) - chunk = chunk.slice(0, n) - this[BUFFERLENGTH] -= n - } - - this.emit('data', chunk) - - if (!this[BUFFER].length && !this[EOF]) this.emit('drain') - - return chunk - } - - end(chunk, encoding, cb) { - if (typeof chunk === 'function') (cb = chunk), (chunk = null) - if (typeof encoding === 'function') (cb = encoding), (encoding = 'utf8') - if (chunk) this.write(chunk, encoding) - if (cb) this.once('end', cb) - this[EOF] = true - this.writable = false - - // if we haven't written anything, then go ahead and emit, - // even if we're not reading. - // we'll re-emit if a new 'end' listener is added anyway. - // This makes MP more suitable to write-only use cases. - if (this.flowing || !this[PAUSED]) this[MAYBE_EMIT_END]() - return this - } - - // don't let the internal resume be overwritten - [RESUME]() { - if (this[DESTROYED]) return - - this[PAUSED] = false - this[FLOWING] = true - this.emit('resume') - if (this[BUFFER].length) this[FLUSH]() - else if (this[EOF]) this[MAYBE_EMIT_END]() - else this.emit('drain') - } - - resume() { - return this[RESUME]() - } - - pause() { - this[FLOWING] = false - this[PAUSED] = true - } - - get destroyed() { - return this[DESTROYED] - } - - get flowing() { - return this[FLOWING] - } - - get paused() { - return this[PAUSED] - } - - [BUFFERPUSH](chunk) { - if (this[OBJECTMODE]) this[BUFFERLENGTH] += 1 - else this[BUFFERLENGTH] += chunk.length - this[BUFFER].push(chunk) - } - - [BUFFERSHIFT]() { - if (this[OBJECTMODE]) this[BUFFERLENGTH] -= 1 - else this[BUFFERLENGTH] -= this[BUFFER][0].length - return this[BUFFER].shift() - } - - [FLUSH](noDrain) { - do {} while (this[FLUSHCHUNK](this[BUFFERSHIFT]()) && this[BUFFER].length) - - if (!noDrain && !this[BUFFER].length && !this[EOF]) this.emit('drain') - } - - [FLUSHCHUNK](chunk) { - this.emit('data', chunk) - return this.flowing - } - - pipe(dest, opts) { - if (this[DESTROYED]) return - - const ended = this[EMITTED_END] - opts = opts || {} - if (dest === proc.stdout || dest === proc.stderr) opts.end = false - else opts.end = opts.end !== false - opts.proxyErrors = !!opts.proxyErrors - - // piping an ended stream ends immediately - if (ended) { - if (opts.end) dest.end() - } else { - this[PIPES].push( - !opts.proxyErrors - ? new Pipe(this, dest, opts) - : new PipeProxyErrors(this, dest, opts) - ) - if (this[ASYNC]) defer(() => this[RESUME]()) - else this[RESUME]() - } - - return dest - } - - unpipe(dest) { - const p = this[PIPES].find(p => p.dest === dest) - if (p) { - this[PIPES].splice(this[PIPES].indexOf(p), 1) - p.unpipe() - } - } - - addListener(ev, fn) { - return this.on(ev, fn) - } - - on(ev, fn) { - const ret = super.on(ev, fn) - if (ev === 'data' && !this[PIPES].length && !this.flowing) this[RESUME]() - else if (ev === 'readable' && this[BUFFERLENGTH] !== 0) - super.emit('readable') - else if (isEndish(ev) && this[EMITTED_END]) { - super.emit(ev) - this.removeAllListeners(ev) - } else if (ev === 'error' && this[EMITTED_ERROR]) { - if (this[ASYNC]) defer(() => fn.call(this, this[EMITTED_ERROR])) - else fn.call(this, this[EMITTED_ERROR]) - } - return ret - } - - get emittedEnd() { - return this[EMITTED_END] - } - - [MAYBE_EMIT_END]() { - if ( - !this[EMITTING_END] && - !this[EMITTED_END] && - !this[DESTROYED] && - this[BUFFER].length === 0 && - this[EOF] - ) { - this[EMITTING_END] = true - this.emit('end') - this.emit('prefinish') - this.emit('finish') - if (this[CLOSED]) this.emit('close') - this[EMITTING_END] = false - } - } - - emit(ev, data, ...extra) { - // error and close are only events allowed after calling destroy() - if (ev !== 'error' && ev !== 'close' && ev !== DESTROYED && this[DESTROYED]) - return - else if (ev === 'data') { - return !this[OBJECTMODE] && !data - ? false - : this[ASYNC] - ? defer(() => this[EMITDATA](data)) - : this[EMITDATA](data) - } else if (ev === 'end') { - return this[EMITEND]() - } else if (ev === 'close') { - this[CLOSED] = true - // don't emit close before 'end' and 'finish' - if (!this[EMITTED_END] && !this[DESTROYED]) return - const ret = super.emit('close') - this.removeAllListeners('close') - return ret - } else if (ev === 'error') { - this[EMITTED_ERROR] = data - super.emit(ERROR, data) - const ret = - !this[SIGNAL] || this.listeners('error').length - ? super.emit('error', data) - : false - this[MAYBE_EMIT_END]() - return ret - } else if (ev === 'resume') { - const ret = super.emit('resume') - this[MAYBE_EMIT_END]() - return ret - } else if (ev === 'finish' || ev === 'prefinish') { - const ret = super.emit(ev) - this.removeAllListeners(ev) - return ret - } - - // Some other unknown event - const ret = super.emit(ev, data, ...extra) - this[MAYBE_EMIT_END]() - return ret - } - - [EMITDATA](data) { - for (const p of this[PIPES]) { - if (p.dest.write(data) === false) this.pause() - } - const ret = super.emit('data', data) - this[MAYBE_EMIT_END]() - return ret - } - - [EMITEND]() { - if (this[EMITTED_END]) return - - this[EMITTED_END] = true - this.readable = false - if (this[ASYNC]) defer(() => this[EMITEND2]()) - else this[EMITEND2]() - } - - [EMITEND2]() { - if (this[DECODER]) { - const data = this[DECODER].end() - if (data) { - for (const p of this[PIPES]) { - p.dest.write(data) - } - super.emit('data', data) - } - } - - for (const p of this[PIPES]) { - p.end() - } - const ret = super.emit('end') - this.removeAllListeners('end') - return ret - } - - // const all = await stream.collect() - collect() { - const buf = [] - if (!this[OBJECTMODE]) buf.dataLength = 0 - // set the promise first, in case an error is raised - // by triggering the flow here. - const p = this.promise() - this.on('data', c => { - buf.push(c) - if (!this[OBJECTMODE]) buf.dataLength += c.length - }) - return p.then(() => buf) - } - - // const data = await stream.concat() - concat() { - return this[OBJECTMODE] - ? Promise.reject(new Error('cannot concat in objectMode')) - : this.collect().then(buf => - this[OBJECTMODE] - ? Promise.reject(new Error('cannot concat in objectMode')) - : this[ENCODING] - ? buf.join('') - : Buffer.concat(buf, buf.dataLength) - ) - } - - // stream.promise().then(() => done, er => emitted error) - promise() { - return new Promise((resolve, reject) => { - this.on(DESTROYED, () => reject(new Error('stream destroyed'))) - this.on('error', er => reject(er)) - this.on('end', () => resolve()) - }) - } - - // for await (let chunk of stream) - [ASYNCITERATOR]() { - let stopped = false - const stop = () => { - this.pause() - stopped = true - return Promise.resolve({ done: true }) - } - const next = () => { - if (stopped) return stop() - const res = this.read() - if (res !== null) return Promise.resolve({ done: false, value: res }) - - if (this[EOF]) return stop() - - let resolve = null - let reject = null - const onerr = er => { - this.removeListener('data', ondata) - this.removeListener('end', onend) - stop() - reject(er) - } - const ondata = value => { - this.removeListener('error', onerr) - this.removeListener('end', onend) - this.pause() - resolve({ value: value, done: !!this[EOF] }) - } - const onend = () => { - this.removeListener('error', onerr) - this.removeListener('data', ondata) - stop() - resolve({ done: true }) - } - const ondestroy = () => onerr(new Error('stream destroyed')) - return new Promise((res, rej) => { - reject = rej - resolve = res - this.once(DESTROYED, ondestroy) - this.once('error', onerr) - this.once('end', onend) - this.once('data', ondata) - }) - } - - return { - next, - throw: stop, - return: stop, - [ASYNCITERATOR]() { - return this - }, - } - } - - // for (let chunk of stream) - [ITERATOR]() { - let stopped = false - const stop = () => { - this.pause() - this.removeListener(ERROR, stop) - this.removeListener('end', stop) - stopped = true - return { done: true } - } - - const next = () => { - if (stopped) return stop() - const value = this.read() - return value === null ? stop() : { value } - } - this.once('end', stop) - this.once(ERROR, stop) - - return { - next, - throw: stop, - return: stop, - [ITERATOR]() { - return this - }, - } - } - - destroy(er) { - if (this[DESTROYED]) { - if (er) this.emit('error', er) - else this.emit(DESTROYED) - return this - } - - this[DESTROYED] = true - - // throw away all buffered data, it's never coming out - this[BUFFER].length = 0 - this[BUFFERLENGTH] = 0 - - if (typeof this.close === 'function' && !this[CLOSED]) this.close() - - if (er) this.emit('error', er) - // if no error to emit, still reject pending promises - else this.emit(DESTROYED) - - return this - } - - static isStream(s) { - return ( - !!s && - (s instanceof Minipass || - s instanceof Stream || - (s instanceof EE && - // readable - (typeof s.pipe === 'function' || - // writable - (typeof s.write === 'function' && typeof s.end === 'function')))) - ) - } -} - -export default Minipass diff --git a/node_modules/minipass/package.json b/node_modules/minipass/package.json deleted file mode 100644 index 4a6246df54..0000000000 --- a/node_modules/minipass/package.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "name": "minipass", - "version": "4.2.4", - "description": "minimal implementation of a PassThrough stream", - "main": "./index.js", - "module": "./index.mjs", - "types": "./index.d.ts", - "exports": { - ".": { - "import": { - "types": "./index.d.ts", - "default": "./index.mjs" - }, - "require": { - "types": "./index.d.ts", - "default": "./index.js" - } - }, - "./package.json": "./package.json" - }, - "devDependencies": { - "@types/node": "^17.0.41", - "end-of-stream": "^1.4.0", - "node-abort-controller": "^3.1.1", - "prettier": "^2.6.2", - "tap": "^16.2.0", - "through2": "^2.0.3", - "ts-node": "^10.8.1", - "typedoc": "^0.23.24", - "typescript": "^4.7.3" - }, - "scripts": { - "pretest": "npm run prepare", - "presnap": "npm run prepare", - "prepare": "node ./scripts/transpile-to-esm.js", - "snap": "tap", - "test": "tap", - "preversion": "npm test", - "postversion": "npm publish", - "postpublish": "git push origin --follow-tags", - "typedoc": "typedoc ./index.d.ts", - "format": "prettier --write . --loglevel warn" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/isaacs/minipass.git" - }, - "keywords": [ - "passthrough", - "stream" - ], - "author": "Isaac Z. Schlueter (http://blog.izs.me/)", - "license": "ISC", - "files": [ - "index.d.ts", - "index.js", - "index.mjs" - ], - "tap": { - "check-coverage": true - }, - "engines": { - "node": ">=8" - }, - "prettier": { - "semi": false, - "printWidth": 80, - "tabWidth": 2, - "useTabs": false, - "singleQuote": true, - "jsxSingleQuote": false, - "bracketSameLine": true, - "arrowParens": "avoid", - "endOfLine": "lf" - } -} diff --git a/node_modules/path-scurry/LICENSE.md b/node_modules/path-scurry/LICENSE.md deleted file mode 100644 index c5402b9577..0000000000 --- a/node_modules/path-scurry/LICENSE.md +++ /dev/null @@ -1,55 +0,0 @@ -# Blue Oak Model License - -Version 1.0.0 - -## Purpose - -This license gives everyone as much permission to work with -this software as possible, while protecting contributors -from liability. - -## Acceptance - -In order to receive this license, you must agree to its -rules. The rules of this license are both obligations -under that agreement and conditions to your license. -You must not do anything with this software that triggers -a rule that you cannot or will not follow. - -## Copyright - -Each contributor licenses you to do everything with this -software that would otherwise infringe that contributor's -copyright in it. - -## Notices - -You must ensure that everyone who gets a copy of -any part of this software from you, with or without -changes, also gets the text of this license or a link to -. - -## Excuse - -If anyone notifies you in writing that you have not -complied with [Notices](#notices), you can keep your -license by taking all practical steps to comply within 30 -days after the notice. If you do not do so, your license -ends immediately. - -## Patent - -Each contributor licenses you to do everything with this -software that would otherwise infringe any patent claims -they can license or become able to license. - -## Reliability - -No contributor can revoke this license. - -## No Liability - -***As far as the law allows, this software comes as is, -without any warranty or condition, and no contributor -will be liable to anyone for any damages related to this -software or this license, under any kind of legal claim.*** diff --git a/node_modules/path-scurry/README.md b/node_modules/path-scurry/README.md deleted file mode 100644 index 5341c09712..0000000000 --- a/node_modules/path-scurry/README.md +++ /dev/null @@ -1,559 +0,0 @@ -# path-scurry - -Extremely high performant utility for building tools that read -the file system, minimizing filesystem and path string munging -operations to the greatest degree possible. - -## Ugh, yet another file traversal thing on npm? - -Yes. None of the existing ones gave me exactly what I wanted. - -## Well what is it you wanted? - -While working on [glob](http://npm.im/glob), I found that I -needed a module to very efficiently manage the traversal over a -folder tree, such that: - -1. No `readdir()` or `stat()` would ever be called on the same - file or directory more than one time. -2. No `readdir()` calls would be made if we can be reasonably - sure that the path is not a directory. (Ie, a previous - `readdir()` or `stat()` covered the path, and - `ent.isDirectory()` is false.) -3. `path.resolve()`, `dirname()`, `basename()`, and other - string-parsing/munging operations are be minimized. This - means it has to track "provisional" child nodes that may not - exist (and if we find that they _don't_ exist, store that - information as well, so we don't have to ever check again). -4. The API is not limited to use as a stream/iterator/etc. There - are many cases where an API like node's `fs` is preferrable. -5. It's more important to prevent excess syscalls than to be up - to date, but it should be smart enough to know what it - _doesn't_ know, and go get it seamlessly when requested. -6. Do not blow up the JS heap allocation if operating on a - directory with a huge number of entries. -7. Handle all the weird aspects of Windows paths, like UNC paths - and drive letters and wrongway slashes, so that the consumer - can return canonical platform-specific paths without having to - parse or join or do any error-prone string munging. - -## PERFORMANCE - -JavaScript people throw around the word "blazing" a lot. I hope -that this module doesn't blaze anyone. But it does go very fast, -in the cases it's optimized for, if used properly. - -PathScurry provides ample opportunities to get extremely good -performance, as well as several options to trade performance for -convenience. - -Benchmarks can be run by executing `npm run bench`. - -As is always the case, doing more means going slower, doing -less means going faster, and there are trade offs between speed -and memory usage. - -PathScurry makes heavy use of [LRUCache](http://npm.im/lru-cache) -to efficiently cache whatever it can, and `Path` objects remain -in the graph for the lifetime of the walker, so repeated calls -with a single PathScurry object will be extremely fast. However, -adding items to a cold cache means "doing more", so in those -cases, we pay a price. Nothing is free, but every effort has been -made to reduce costs wherever possible. - -Also, note that a "cache as long as possible" approach means that -changes to the filesystem may not be reflected in the results of -repeated PathScurry operations. - -For resolving string paths, `PathScurry` ranges from 5-50 times -faster than `path.resolve` on repeated resolutions, but around -100 to 1000 times _slower_ on the first resolution. If your -program is spending a lot of time resolving the _same_ paths -repeatedly (like, thousands or millions of times), then this can -be beneficial. But both implementations are pretty fast, and -speeding up an infrequent operation from 4µs to 400ns is not -going to move the needle on your app's performance. - -For walking file system directory trees, a lot depends on how -often a given PathScurry object will be used, and also on the -walk method used. - -With default settings on a folder tree of 100,000 items, -consisting of around a 10-to-1 ratio of normal files to -directories, PathScurry performs comparably to -[@nodelib/fs.walk](http://npm.im/@nodelib/fs.walk), which is the -fastest and most reliable file system walker I could find. As -far as I can tell, it's almost impossible to go much faster in a -Node.js program, just based on how fast you can push syscalls out -to the fs thread pool. - -On my machine, that is about 1000-1200 completed walks per second -for async or stream walks, and around 500-600 walks per second -synchronously. - -In the warm cache state, PathScurry's performance increases -around 4x for async `for await` iteration, 10-15x faster for -streams and synchronous `for of` iteration, and anywhere from 30x -to 80x faster for the rest. - -``` -# walk 100,000 fs entries, 10/1 file/dir ratio -# operations / ms - New PathScurry object | Reuse PathScurry object - stream: 1112.589 | 13974.917 -sync stream: 492.718 | 15028.343 - async walk: 1095.648 | 32706.395 - sync walk: 527.632 | 46129.772 - async iter: 1288.821 | 5045.510 - sync iter: 498.496 | 17920.746 -``` - -A hand-rolled walk calling `entry.readdir()` and recursing -through the entries can benefit even more from caching, with -greater flexibility and without the overhead of streams or -generators. - -The cold cache state is still limited by the costs of file system -operations, but with a warm cache, the only bottleneck is CPU -speed and VM optimizations. Of course, in that case, some care -must be taken to ensure that you don't lose performance as a -result of silly mistakes, like calling `readdir()` on entries -that you know are not directories. - -``` -# manual recursive iteration functions - cold cache | warm cache -async: 1164.901 | 17923.320 - cb: 1101.127 | 40999.344 -zalgo: 1082.240 | 66689.936 - sync: 526.935 | 87097.591 -``` - -In this case, the speed improves by around 10-20x in the async -case, 40x in the case of using `entry.readdirCB` with protections -against synchronous callbacks, and 50-100x with callback -deferrals disabled, and _several hundred times faster_ for -synchronous iteration. - -If you can think of a case that is not covered in these -benchmarks, or an implementation that performs significantly -better than PathScurry, please [let me -know](https://github.com/isaacs/path-scurry/issues). - -## USAGE - -```ts -// hybrid module, load with either method -import { PathScurry, Path } from 'path-scurry' -// or: -const { PathScurry, Path } = require('path-scurry') - -// very simple example, say we want to find and -// delete all the .DS_Store files in a given path -// note that the API is very similar to just a -// naive walk with fs.readdir() -import { unlink } from 'fs/promises' - -// easy way, iterate over the directory and do the thing -const pw = new PathScurry(process.cwd()) -for await (const entry of pw) { - if (entry.isFile() && entry.name === '.DS_Store') { - unlink(entry.fullpath()) - } -} - -// here it is as a manual recursive method -const walk = async (entry: Path) => { - const promises: Promise = [] - // readdir doesn't throw on non-directories, it just doesn't - // return any entries, to save stack trace costs. - // Items are returned in arbitrary unsorted order - for (const child of await pw.readdir(entry)) { - // each child is a Path object - if (child.name === '.DS_Store' && child.isFile()) { - // could also do pw.resolve(entry, child.name), - // just like fs.readdir walking, but .fullpath is - // a *slightly* more efficient shorthand. - promises.push(unlink(child.fullpath())) - } else if (child.isDirectory()) { - promises.push(walk(child)) - } - } - return Promise.all(promises) -} - -walk(pw.cwd).then(() => { - console.log('all .DS_Store files removed') -}) - -const pw2 = new PathScurry('/a/b/c') // pw2.cwd is the Path for /a/b/c -const relativeDir = pw2.cwd.resolve('../x') // Path entry for '/a/b/x' -const relative2 = pw2.cwd.resolve('/a/b/d/../x') // same path, same entry -assert.equal(relativeDir, relative2) -``` - -## API - -[Full TypeDoc API](https://isaacs.github.io/path-scurry) - -There are platform-specific classes exported, but for the most -part, the default `PathScurry` and `Path` exports are what you -most likely need, unless you are testing behavior for other -platforms. - -Intended public API is documented here, but the full -documentation does include internal types, which should not be -accessed directly. - -### Interface `PathScurryOpts` - -The type of the `options` argument passed to the `PathScurry` -constructor. - -- `nocase`: Boolean indicating that file names should be compared - case-insensitively. Defaults to `true` on darwin and win32 - implementations, `false` elsewhere. - - **Warning** Performing case-insensitive matching on a - case-sensitive filesystem will result in occasionally very - bizarre behavior. Performing case-sensitive matching on a - case-insensitive filesystem may negatively impact performance. - -- `childrenCacheSize`: Number of child entries to cache, in order - to speed up `resolve()` and `readdir()` calls. Defaults to - `16 * 1024` (ie, `16384`). - - Setting it to a higher value will run the risk of JS heap - allocation errors on large directory trees. Setting it to `256` - or smaller will significantly reduce the construction time and - data consumption overhead, but with the downside of operations - being slower on large directory trees. Setting it to `0` will - mean that effectively no operations are cached, and this module - will be roughly the same speed as `fs` for file system - operations, and _much_ slower than `path.resolve()` for - repeated path resolution. - -- `fs` An object that will be used to override the default `fs` - methods. Any methods that are not overridden will use Node's - built-in implementations. - - - lstatSync - - readdir (callback `withFileTypes` Dirent variant, used for - readdirCB and most walks) - - readdirSync - - readlinkSync - - realpathSync - - promises: Object containing the following async methods: - - lstat - - readdir (Dirent variant only) - - readlink - - realpath - -### Interface `WalkOptions` - -The options object that may be passed to all walk methods. - -- `withFileTypes`: Boolean, default true. Indicates that `Path` - objects should be returned. Set to `false` to get string paths - instead. -- `follow`: Boolean, default false. Attempt to read directory - entries from symbolic links. Otherwise, only actual directories - are traversed. Regardless of this setting, a given target path - will only ever be walked once, meaning that a symbolic link to - a previously traversed directory will never be followed. - - Setting this imposes a slight performance penalty, because - `readlink` must be called on all symbolic links encountered, in - order to avoid infinite cycles. - -- `filter`: Function `(entry: Path) => boolean`. If provided, - will prevent the inclusion of any entry for which it returns a - falsey value. This will not prevent directories from being - traversed if they do not pass the filter, though it will - prevent the directories themselves from being included in the - results. By default, if no filter is provided, then all - entries are included in the results. -- `walkFilter`: Function `(entry: Path) => boolean`. If - provided, will prevent the traversal of any directory (or in - the case of `follow:true` symbolic links to directories) for - which the function returns false. This will not prevent the - directories themselves from being included in the result set. - Use `filter` for that. - -Note that TypeScript return types will only be inferred properly -from static analysis if the `withFileTypes` option is omitted, or -a constant `true` or `false` value. - -### Class `PathScurry` - -The main interface. Defaults to an appropriate class based on -the current platform. - -Use `PathScurryWin32`, `PathScurryDarwin`, or `PathScurryPosix` -if implementation-specific behavior is desired. - -All walk methods may be called with a `WalkOptions` argument to -walk over the object's current working directory with the -supplied options. - -#### `async pw.walk(entry?: string | Path | WalkOptions, opts?: WalkOptions)` - -Walk the directory tree according to the options provided, -resolving to an array of all entries found. - -#### `pw.walkSync(entry?: string | Path | WalkOptions, opts?: WalkOptions)` - -Walk the directory tree according to the options provided, -returning an array of all entries found. - -#### `pw.iterate(entry?: string | Path | WalkOptions, opts?: WalkOptions)` - -Iterate over the directory asynchronously, for use with `for -await of`. This is also the default async iterator method. - -#### `pw.iterateSync(entry?: string | Path | WalkOptions, opts?: WalkOptions)` - -Iterate over the directory synchronously, for use with `for of`. -This is also the default sync iterator method. - -#### `pw.stream(entry?: string | Path | WalkOptions, opts?: WalkOptions)` - -Return a [Minipass](http://npm.im/minipass) stream that emits -each entry or path string in the walk. Results are made -available asynchronously. - -#### `pw.streamSync(entry?: string | Path | WalkOptions, opts?: WalkOptions)` - -Return a [Minipass](http://npm.im/minipass) stream that emits -each entry or path string in the walk. Results are made -available synchronously, meaning that the walk will complete in a -single tick if the stream is fully consumed. - -#### `pw.cwd` - -Path object representing the current working directory for the -PathScurry. - -#### `pw.depth(path?: Path | string): number` - -Return the depth of the specified path (or the PathScurry cwd) -within the directory tree. - -Root entries have a depth of `0`. - -#### `pw.resolve(...paths: string[])` - -Caching `path.resolve()`. - -Significantly faster than `path.resolve()` if called repeatedly -with the same paths. Significantly slower otherwise, as it -builds out the cached Path entries. - -To get a `Path` object resolved from the `PathScurry`, use -`pw.cwd.resolve(path)`. Note that `Path.resolve` only takes a -single string argument, not multiple. - -#### `pw.relative(path: string | Path): string` - -Return the relative path from the PathWalker cwd to the supplied -path string or entry. - -If the nearest common ancestor is the root, then an absolute path -is returned. - -#### `pw.basename(path: string | Path): string` - -Return the basename of the provided string or Path. - -#### `pw.dirname(path: string | Path): string` - -Return the parent directory of the supplied string or Path. - -#### `async pw.readdir(dir = pw.cwd, opts = { withFileTypes: true })` - -Read the directory and resolve to an array of strings if -`withFileTypes` is explicitly set to `false` or Path objects -otherwise. - -Can be called as `pw.readdir({ withFileTypes: boolean })` as -well. - -Returns `[]` if no entries are found, or if any error occurs. - -Note that TypeScript return types will only be inferred properly -from static analysis if the `withFileTypes` option is omitted, or -a constant `true` or `false` value. - -#### `pw.readdirSync(dir = pw.cwd, opts = { withFileTypes: true })` - -Synchronous `pw.readdir()` - -#### `async pw.readlink(link = pw.cwd, opts = { withFileTypes: false })` - -Call `fs.readlink` on the supplied string or Path object, and -return the result. - -Can be called as `pw.readlink({ withFileTypes: boolean })` as -well. - -Returns `undefined` if any error occurs (for example, if the -argument is not a symbolic link), or a `Path` object if -`withFileTypes` is explicitly set to `true`, or a string -otherwise. - -Note that TypeScript return types will only be inferred properly -from static analysis if the `withFileTypes` option is omitted, or -a constant `true` or `false` value. - -#### `pw.readlinkSync(link = pw.cwd, opts = { withFileTypes: false })` - -Synchronous `pw.readlink()` - -#### `async pw.lstat(entry = pw.cwd)` - -Call `fs.lstat` on the supplied string or Path object, and fill -in as much information as possible, returning the updated `Path` -object. - -Returns `undefined` if the entry does not exist, or if any error -is encountered. - -Note that some `Stats` data (such as `ino`, `dev`, and `mode`) will -not be supplied. For those things, you'll need to call -`fs.lstat` yourself. - -#### `pw.lstatSync(entry = pw.cwd)` - -Synchronous `pw.lstat()` - -#### `pw.realpath(entry = pw.cwd, opts = { withFileTypes: false })` - -Call `fs.realpath` on the supplied string or Path object, and -return the realpath if available. - -Returns `undefined` if any error occurs. - -May be called as `pw.realpath({ withFileTypes: boolean })` to run -on `pw.cwd`. - -#### `pw.realpathSync(entry = pw.cwd, opts = { withFileTypes: false })` - -Synchronous `pw.realpath()` - -### Class `Path` implements [fs.Dirent](https://nodejs.org/docs/latest/api/fs.html#class-fsdirent) - -Object representing a given path on the filesystem, which may or -may not exist. - -Note that the actual class in use will be either `PathWin32` or -`PathPosix`, depending on the implementation of `PathScurry` in -use. They differ in the separators used to split and join path -strings, and the handling of root paths. - -In `PathPosix` implementations, paths are split and joined using -the `'/'` character, and `'/'` is the only root path ever in use. - -In `PathWin32` implementations, paths are split using either -`'/'` or `'\\'` and joined using `'\\'`, and multiple roots may -be in use based on the drives and UNC paths encountered. UNC -paths such as `//?/C:/` that identify a drive letter, will be -treated as an alias for the same root entry as their associated -drive letter (in this case `'C:\\'`). - -#### `path.name` - -Name of this file system entry. - -**Important**: *always* test the path name against any test -string using the `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. - -#### `path.isNamed(s: string)` - -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. - -#### `path.depth()` - -Return the depth of the Path entry within the directory tree. -Root paths have a depth of `0`. - -#### `path.fullpath()` - -The fully resolved path to the entry. - -#### `path.isFile()`, `path.isDirectory()`, etc. - -Same as the identical `fs.Dirent.isX()` methods. - -#### `path.isUnknown()` - -Returns true if the path's type is unknown. Always returns true -when the path is known to not exist. - -#### `path.resolve(p: string)` - -Return a `Path` object associated with the provided path string -as resolved from the current Path object. - -#### `path.relative(): string` - -Return the relative path from the PathWalker cwd to the supplied -path string or entry. - -If the nearest common ancestor is the root, then an absolute path -is returned. - -#### `async path.readdir()` - -Return an array of `Path` objects found by reading the associated -path entry. - -If path is not a directory, or if any error occurs, returns `[]`, -and marks all children as provisional and non-existent. - -#### `path.readdirSync()` - -Synchronous `path.readdir()` - -#### `async path.readlink()` - -Return the `Path` object referenced by the `path` as a symbolic -link. - -If the `path` is not a symbolic link, or any error occurs, -returns `undefined`. - -#### `path.readlinkSync()` - -Synchronous `path.readlink()` - -#### `async path.lstat()` - -Call `lstat` on the path object, and fill it in with details -determined. - -If path does not exist, or any other error occurs, returns -`undefined`, and marks the path as "unknown" type. - -#### `path.lstatSync()` - -Synchronous `path.lstat()` - -#### `async path.realpath()` - -Call `realpath` on the path, and return a Path object -corresponding to the result, or `undefined` if any error occurs. - -#### `path.realpathSync()` - -Synchornous `path.realpath()` diff --git a/node_modules/path-scurry/dist/cjs/index.d.ts b/node_modules/path-scurry/dist/cjs/index.d.ts deleted file mode 100644 index 7ff22c2d7f..0000000000 --- a/node_modules/path-scurry/dist/cjs/index.d.ts +++ /dev/null @@ -1,1055 +0,0 @@ -/// -/// -/// -import LRUCache from 'lru-cache'; -import { posix, win32 } from 'path'; -import type { Dirent, Stats } from 'fs'; -import Minipass from 'minipass'; -/** - * An object that will be used to override the default `fs` - * methods. Any methods that are not overridden will use Node's - * built-in implementations. - * - * - lstatSync - * - readdir (callback `withFileTypes` Dirent variant, used for - * readdirCB and most walks) - * - readdirSync - * - readlinkSync - * - realpathSync - * - promises: Object containing the following async methods: - * - lstat - * - readdir (Dirent variant only) - * - readlink - * - realpath - */ -export interface FSOption { - lstatSync?: (path: string) => Stats; - readdir?: (path: string, options: { - withFileTypes: true; - }, cb: (er: NodeJS.ErrnoException | null, entries?: Dirent[]) => any) => void; - readdirSync?: (path: string, options: { - withFileTypes: true; - }) => Dirent[]; - readlinkSync?: (path: string) => string; - realpathSync?: (path: string) => string; - promises?: { - lstat?: (path: string) => Promise; - readdir?: (path: string, options: { - withFileTypes: true; - }) => Promise; - readlink?: (path: string) => Promise; - realpath?: (path: string) => Promise; - [k: string]: any; - }; - [k: string]: any; -} -interface FSValue { - lstatSync: (path: string) => Stats; - readdir: (path: string, options: { - withFileTypes: true; - }, cb: (er: NodeJS.ErrnoException | null, entries?: Dirent[]) => any) => void; - readdirSync: (path: string, options: { - withFileTypes: true; - }) => Dirent[]; - readlinkSync: (path: string) => string; - realpathSync: (path: string) => string; - promises: { - lstat: (path: string) => Promise; - readdir: (path: string, options: { - withFileTypes: true; - }) => Promise; - readlink: (path: string) => Promise; - realpath: (path: string) => Promise; - [k: string]: any; - }; - [k: string]: any; -} -/** - * Options that may be provided to the Path constructor - */ -export interface PathOpts { - fullpath?: string; - relative?: string; - parent?: PathBase; - /** - * See {@link FSOption} - */ - fs?: FSOption; -} -/** - * An LRUCache for storing resolved path strings or Path objects. - * @internal - */ -export declare class ResolveCache extends LRUCache { - constructor(); -} -/** - * an LRUCache for storing child entries. - * @internal - */ -export declare class ChildrenCache extends LRUCache { - constructor(maxSize?: number); -} -/** - * Array of Path objects, plus a marker indicating the first provisional entry - * - * @internal - */ -export type Children = PathBase[] & { - provisional: number; -}; -/** - * Path objects are sort of like a super-powered - * {@link https://nodejs.org/docs/latest/api/fs.html#class-fsdirent fs.Dirent} - * - * Each one represents a single filesystem entry on disk, which may or may not - * exist. It includes methods for reading various types of information via - * lstat, readlink, and readdir, and caches all information to the greatest - * degree possible. - * - * Note that fs operations that would normally throw will instead return an - * "empty" value. This is in order to prevent excessive overhead from error - * stack traces. - */ -export declare abstract class PathBase implements Dirent { - #private; - /** - * 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: string; - /** - * the Path entry corresponding to the path root. - * - * @internal - */ - root: PathBase; - /** - * All roots found within the current PathScurry family - * - * @internal - */ - roots: { - [k: string]: PathBase; - }; - /** - * a reference to the parent path, or undefined in the case of root entries - * - * @internal - */ - parent?: PathBase; - /** - * boolean indicating whether paths are compared case-insensitively - * @internal - */ - nocase: boolean; - /** - * the string or regexp used to split paths. On posix, it is `'/'`, and on - * windows it is a RegExp matching either `'/'` or `'\\'` - */ - abstract splitSep: string | RegExp; - /** - * The path separator string to use when joining paths - */ - abstract sep: string; - get dev(): number | undefined; - get mode(): number | undefined; - get nlink(): number | undefined; - get uid(): number | undefined; - get gid(): number | undefined; - get rdev(): number | undefined; - get blksize(): number | undefined; - get ino(): number | undefined; - get size(): number | undefined; - get blocks(): number | undefined; - get atimeMs(): number | undefined; - get mtimeMs(): number | undefined; - get ctimeMs(): number | undefined; - get birthtimeMs(): number | undefined; - get atime(): Date | undefined; - get mtime(): Date | undefined; - get ctime(): Date | undefined; - get birthtime(): Date | undefined; - /** - * 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: string, type: number | undefined, root: PathBase | undefined, roots: { - [k: string]: PathBase; - }, nocase: boolean, children: ChildrenCache, opts: PathOpts); - /** - * Returns the depth of the Path object from its root. - * - * For example, a path at `/foo/bar` would have a depth of 2. - */ - depth(): number; - /** - * @internal - */ - abstract getRootString(path: string): string; - /** - * @internal - */ - abstract getRoot(rootPath: string): PathBase; - /** - * @internal - */ - abstract newChild(name: string, type?: number, opts?: PathOpts): PathBase; - /** - * @internal - */ - childrenCache(): ChildrenCache; - /** - * Get the Path object referenced by the string path, resolved from this Path - */ - resolve(path?: string): PathBase; - /** - * 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(): 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: string, opts?: PathOpts): PathBase; - /** - * 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(): string; - /** - * The fully resolved path string for this Path entry - */ - fullpath(): string; - /** - * 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. - */ - isUnknown(): boolean; - /** - * Is the Path a regular file? - */ - isFile(): boolean; - /** - * Is the Path a directory? - */ - isDirectory(): boolean; - /** - * Is the path a character device? - */ - isCharacterDevice(): boolean; - /** - * Is the path a block device? - */ - isBlockDevice(): boolean; - /** - * Is the path a FIFO pipe? - */ - isFIFO(): boolean; - /** - * Is the path a socket? - */ - isSocket(): boolean; - /** - * Is the path a symbolic link? - */ - isSymbolicLink(): boolean; - /** - * 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(): PathBase | undefined; - /** - * 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(): PathBase | undefined; - /** - * 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(): PathBase | undefined; - /** - * 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(): PathBase[]; - /** - * 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(): boolean; - /** - * Return true if readdir has previously been successfully called on this - * path, indicating that cachedReaddir() is likely valid. - */ - calledReaddir(): boolean; - /** - * 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. - */ - isENOENT(): boolean; - /** - * 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. - */ - isNamed(n: string): boolean; - /** - * Return the Path object corresponding to the target of a symbolic link. - * - * 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. - */ - readlink(): Promise; - /** - * Synchronous {@link PathBase.readlink} - */ - readlinkSync(): PathBase | undefined; - /** - * 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. - */ - lstat(): Promise; - /** - * synchronous {@link PathBase.lstat} - */ - lstatSync(): PathBase | undefined; - /** - * 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. - */ - readdirCB(cb: (er: NodeJS.ErrnoException | null, entries: PathBase[]) => any, allowZalgo?: boolean): void; - /** - * Return an array of known child 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. - */ - readdir(): Promise; - /** - * synchronous {@link PathBase.readdir} - */ - readdirSync(): PathBase[]; - canReaddir(): boolean; - shouldWalk(dirs: Set, walkFilter?: (e: PathBase) => boolean): boolean; - /** - * 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. - */ - realpath(): Promise; - /** - * Synchronous {@link realpath} - */ - realpathSync(): PathBase | undefined; -} -/** - * Path class used on win32 systems - * - * Uses `'\\'` as the path separator for returned paths, either `'\\'` or `'/'` - * as the path separator for parsing paths. - */ -export declare class PathWin32 extends PathBase { - /** - * Separator for generating path strings. - */ - sep: '\\'; - /** - * Separator for parsing path strings. - */ - splitSep: RegExp; - /** - * 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: string, type: number | undefined, root: PathBase | undefined, roots: { - [k: string]: PathBase; - }, nocase: boolean, children: ChildrenCache, opts: PathOpts); - /** - * @internal - */ - newChild(name: string, type?: number, opts?: PathOpts): PathWin32; - /** - * @internal - */ - getRootString(path: string): string; - /** - * @internal - */ - getRoot(rootPath: string): PathBase; - /** - * @internal - */ - sameRoot(rootPath: string, compare?: string): boolean; -} -/** - * Path class used on all posix systems. - * - * Uses `'/'` as the path separator. - */ -export declare class PathPosix extends PathBase { - /** - * separator for parsing path strings - */ - splitSep: '/'; - /** - * 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: string, type: number | undefined, root: PathBase | undefined, roots: { - [k: string]: PathBase; - }, nocase: boolean, children: ChildrenCache, opts: PathOpts); - /** - * @internal - */ - getRootString(path: string): string; - /** - * @internal - */ - getRoot(_rootPath: string): PathBase; - /** - * @internal - */ - newChild(name: string, type?: number, opts?: PathOpts): PathPosix; -} -/** - * Options that may be provided to the PathScurry constructor - */ -export interface PathScurryOpts { - /** - * perform case-insensitive path matching. Default based on platform - * subclass. - */ - nocase?: boolean; - /** - * Number of Path entries to keep in the cache of Path child references. - * - * Setting this higher than 65536 will dramatically increase the data - * consumption and construction time overhead of each PathScurry. - * - * Setting this value to 256 or lower will significantly reduce the data - * consumption and construction time overhead, but may also reduce resolve() - * and readdir() performance on large filesystems. - * - * Default `16384`. - */ - childrenCacheSize?: number; - /** - * An object that overrides the built-in functions from the fs and - * fs/promises modules. - * - * See {@link FSOption} - */ - fs?: FSOption; -} -/** - * 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. - */ -export declare abstract class PathScurryBase { - #private; - /** - * The root Path entry for the current working directory of this Scurry - */ - root: PathBase; - /** - * The string path for the root of this Scurry's current working directory - */ - rootPath: string; - /** - * A collection of all roots encountered, referenced by rootPath - */ - roots: { - [k: string]: PathBase; - }; - /** - * The Path entry corresponding to this PathScurry's current working directory. - */ - cwd: PathBase; - /** - * Perform path comparisons case-insensitively. - * - * Defaults true on Darwin and Windows systems, false elsewhere. - */ - nocase: boolean; - /** - * The path separator used for parsing paths - * - * `'/'` on Posix systems, either `'/'` or `'\\'` on Windows - */ - abstract sep: string | RegExp; - /** - * This class should not be instantiated directly. - * - * Use PathScurryWin32, PathScurryDarwin, PathScurryPosix, or PathScurry - * - * @internal - */ - constructor(cwd: string | URL | undefined, pathImpl: typeof win32 | typeof posix, sep: string | RegExp, { nocase, childrenCacheSize, fs, }?: PathScurryOpts); - /** - * Get the depth of a provided path, string, or the cwd - */ - depth(path?: Path | string): number; - /** - * Parse the root portion of a path string - * - * @internal - */ - abstract parseRootPath(dir: string): string; - /** - * create a new Path to use as root during construction. - * - * @internal - */ - abstract newRoot(fs: FSValue): PathBase; - /** - * Determine whether a given path string is absolute - */ - abstract isAbsolute(p: string): boolean; - /** - * Return the cache of child entries. Exposed so subclasses can create - * child Path objects in a platform-specific way. - * - * @internal - */ - childrenCache(): ChildrenCache; - /** - * 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: string[]): string; - /** - * find the relative path from the cwd to the supplied path string or entry - */ - relative(entry?: PathBase | string): string; - /** - * Return the basename for the provided string or Path object - */ - basename(entry?: PathBase | string): string; - /** - * Return the dirname for the provided string or Path object - */ - dirname(entry?: PathBase | string): string; - /** - * Return an array of known child entries. - * - * First argument may be either a string, or a Path object. - * - * 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. - * - * Unlike `fs.readdir()`, the `withFileTypes` option defaults to `true`. Set - * `{ withFileTypes: false }` to return strings. - */ - readdir(): Promise; - readdir(opts: { - withFileTypes: true; - }): Promise; - readdir(opts: { - withFileTypes: false; - }): Promise; - readdir(opts: { - withFileTypes: boolean; - }): Promise; - readdir(entry: PathBase | string): Promise; - readdir(entry: PathBase | string, opts: { - withFileTypes: true; - }): Promise; - readdir(entry: PathBase | string, opts: { - withFileTypes: false; - }): Promise; - readdir(entry: PathBase | string, opts: { - withFileTypes: boolean; - }): Promise; - /** - * synchronous {@link PathScurryBase.readdir} - */ - readdirSync(): PathBase[]; - readdirSync(opts: { - withFileTypes: true; - }): PathBase[]; - readdirSync(opts: { - withFileTypes: false; - }): string[]; - readdirSync(opts: { - withFileTypes: boolean; - }): PathBase[] | string[]; - readdirSync(entry: PathBase | string): PathBase[]; - readdirSync(entry: PathBase | string, opts: { - withFileTypes: true; - }): PathBase[]; - readdirSync(entry: PathBase | string, opts: { - withFileTypes: false; - }): string[]; - readdirSync(entry: PathBase | string, opts: { - withFileTypes: boolean; - }): PathBase[] | string[]; - /** - * 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. - */ - lstat(entry?: string | PathBase): Promise; - /** - * synchronous {@link PathScurryBase.lstat} - */ - lstatSync(entry?: string | PathBase): PathBase | undefined; - /** - * Return the Path object or string path corresponding to the target of a - * symbolic link. - * - * 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. - * - * `{withFileTypes}` option defaults to `false`. - * - * On success, returns a Path object if `withFileTypes` option is true, - * otherwise a string. - */ - readlink(): Promise; - readlink(opt: { - withFileTypes: false; - }): Promise; - readlink(opt: { - withFileTypes: true; - }): Promise; - readlink(opt: { - withFileTypes: boolean; - }): Promise; - readlink(entry: string | PathBase, opt?: { - withFileTypes: false; - }): Promise; - readlink(entry: string | PathBase, opt: { - withFileTypes: true; - }): Promise; - readlink(entry: string | PathBase, opt: { - withFileTypes: boolean; - }): Promise; - /** - * synchronous {@link PathScurryBase.readlink} - */ - readlinkSync(): string | undefined; - readlinkSync(opt: { - withFileTypes: false; - }): string | undefined; - readlinkSync(opt: { - withFileTypes: true; - }): PathBase | undefined; - readlinkSync(opt: { - withFileTypes: boolean; - }): PathBase | string | undefined; - readlinkSync(entry: string | PathBase, opt?: { - withFileTypes: false; - }): string | undefined; - readlinkSync(entry: string | PathBase, opt: { - withFileTypes: true; - }): PathBase | undefined; - readlinkSync(entry: string | PathBase, opt: { - withFileTypes: boolean; - }): string | PathBase | undefined; - /** - * Return the Path object or string path 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. - * - * `{withFileTypes}` option defaults to `false`. - * - * On success, returns a Path object if `withFileTypes` option is true, - * otherwise a string. - */ - realpath(): Promise; - realpath(opt: { - withFileTypes: false; - }): Promise; - realpath(opt: { - withFileTypes: true; - }): Promise; - realpath(opt: { - withFileTypes: boolean; - }): Promise; - realpath(entry: string | PathBase, opt?: { - withFileTypes: false; - }): Promise; - realpath(entry: string | PathBase, opt: { - withFileTypes: true; - }): Promise; - realpath(entry: string | PathBase, opt: { - withFileTypes: boolean; - }): Promise; - realpathSync(): string | undefined; - realpathSync(opt: { - withFileTypes: false; - }): string | undefined; - realpathSync(opt: { - withFileTypes: true; - }): PathBase | undefined; - realpathSync(opt: { - withFileTypes: boolean; - }): PathBase | string | undefined; - realpathSync(entry: string | PathBase, opt?: { - withFileTypes: false; - }): string | undefined; - realpathSync(entry: string | PathBase, opt: { - withFileTypes: true; - }): PathBase | undefined; - realpathSync(entry: string | PathBase, opt: { - withFileTypes: boolean; - }): string | PathBase | undefined; - /** - * Asynchronously walk the directory tree, returning an array of - * all path strings or Path objects found. - * - * Note that this will be extremely memory-hungry on large filesystems. - * In such cases, it may be better to use the stream or async iterator - * walk implementation. - */ - walk(): Promise; - walk(opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): Promise; - walk(opts: WalkOptionsWithFileTypesFalse): Promise; - walk(opts: WalkOptions): Promise; - walk(entry: string | PathBase): Promise; - walk(entry: string | PathBase, opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): Promise; - walk(entry: string | PathBase, opts: WalkOptionsWithFileTypesFalse): Promise; - walk(entry: string | PathBase, opts: WalkOptions): Promise; - /** - * Synchronously walk the directory tree, returning an array of - * all path strings or Path objects found. - * - * Note that this will be extremely memory-hungry on large filesystems. - * In such cases, it may be better to use the stream or async iterator - * walk implementation. - */ - walkSync(): PathBase[]; - walkSync(opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): PathBase[]; - walkSync(opts: WalkOptionsWithFileTypesFalse): string[]; - walkSync(opts: WalkOptions): string[] | PathBase[]; - walkSync(entry: string | PathBase): PathBase[]; - walkSync(entry: string | PathBase, opts: WalkOptionsWithFileTypesUnset | WalkOptionsWithFileTypesTrue): PathBase[]; - walkSync(entry: string | PathBase, opts: WalkOptionsWithFileTypesFalse): string[]; - walkSync(entry: string | PathBase, opts: WalkOptions): PathBase[] | string[]; - /** - * 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](): AsyncGenerator; - /** - * Async generator form of {@link PathScurryBase.walk} - * - * Note: As of Node 19, this is very slow, compared to other methods of - * walking, especially if most/all of the directory tree has been previously - * walked. Consider using {@link PathScurryBase.stream} if memory overhead - * and backpressure are concerns, or {@link PathScurryBase.walk} if not. - */ - iterate(): AsyncGenerator; - iterate(opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): AsyncGenerator; - iterate(opts: WalkOptionsWithFileTypesFalse): AsyncGenerator; - iterate(opts: WalkOptions): AsyncGenerator; - iterate(entry: string | PathBase): AsyncGenerator; - iterate(entry: string | PathBase, opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): AsyncGenerator; - iterate(entry: string | PathBase, opts: WalkOptionsWithFileTypesFalse): AsyncGenerator; - iterate(entry: string | PathBase, opts: WalkOptions): AsyncGenerator; - /** - * Iterating over a PathScurry performs a synchronous walk. - * - * Alias for {@link PathScurryBase.iterateSync} - */ - [Symbol.iterator](): Generator; - iterateSync(): Generator; - iterateSync(opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): Generator; - iterateSync(opts: WalkOptionsWithFileTypesFalse): Generator; - iterateSync(opts: WalkOptions): Generator; - iterateSync(entry: string | PathBase): Generator; - iterateSync(entry: string | PathBase, opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): Generator; - iterateSync(entry: string | PathBase, opts: WalkOptionsWithFileTypesFalse): Generator; - iterateSync(entry: string | PathBase, opts: WalkOptions): Generator; - /** - * Stream form of {@link PathScurryBase.walk} - * - * Returns a Minipass stream that emits {@link PathBase} objects by default, - * or strings if `{ withFileTypes: false }` is set in the options. - */ - stream(): Minipass; - stream(opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): Minipass; - stream(opts: WalkOptionsWithFileTypesFalse): Minipass; - stream(opts: WalkOptions): Minipass; - stream(entry: string | PathBase): Minipass; - stream(entry: string | PathBase, opts: WalkOptionsWithFileTypesUnset | WalkOptionsWithFileTypesTrue): Minipass; - stream(entry: string | PathBase, opts: WalkOptionsWithFileTypesFalse): Minipass; - stream(entry: string | PathBase, opts: WalkOptions): Minipass | Minipass; - /** - * Synchronous form of {@link PathScurryBase.stream} - * - * Returns a Minipass stream that emits {@link PathBase} objects by default, - * or strings if `{ withFileTypes: false }` is set in the options. - * - * Will complete the walk in a single tick if the stream is consumed fully. - * Otherwise, will pause as needed for stream backpressure. - */ - streamSync(): Minipass; - streamSync(opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): Minipass; - streamSync(opts: WalkOptionsWithFileTypesFalse): Minipass; - streamSync(opts: WalkOptions): Minipass; - streamSync(entry: string | PathBase): Minipass; - streamSync(entry: string | PathBase, opts: WalkOptionsWithFileTypesUnset | WalkOptionsWithFileTypesTrue): Minipass; - streamSync(entry: string | PathBase, opts: WalkOptionsWithFileTypesFalse): Minipass; - streamSync(entry: string | PathBase, opts: WalkOptions): Minipass | Minipass; -} -/** - * Options provided to all walk methods. - */ -export interface WalkOptions { - /** - * Return results as {@link PathBase} objects rather than strings. - * When set to false, results are fully resolved paths, as returned by - * {@link PathBase.fullpath}. - * @default true - */ - withFileTypes?: boolean; - /** - * Attempt to read directory entries from symbolic links. Otherwise, only - * actual directories are traversed. Regardless of this setting, a given - * target path will only ever be walked once, meaning that a symbolic link - * to a previously traversed directory will never be followed. - * - * Setting this imposes a slight performance penalty, because `readlink` - * must be called on all symbolic links encountered, in order to avoid - * infinite cycles. - * @default false - */ - follow?: boolean; - /** - * Only return entries where the provided function returns true. - * - * This will not prevent directories from being traversed, even if they do - * not pass the filter, though it will prevent directories themselves from - * being included in the result set. See {@link walkFilter} - * - * Asynchronous functions are not supported here. - * - * By default, if no filter is provided, all entries and traversed - * directories are included. - */ - filter?: (entry: PathBase) => boolean; - /** - * Only traverse directories (and in the case of {@link follow} being set to - * true, symbolic links to directories) if the provided function returns - * true. - * - * This will not prevent directories from being included in the result set, - * even if they do not pass the supplied filter function. See {@link filter} - * to do that. - * - * Asynchronous functions are not supported here. - */ - walkFilter?: (entry: PathBase) => boolean; -} -export type WalkOptionsWithFileTypesUnset = WalkOptions & { - withFileTypes?: undefined; -}; -export type WalkOptionsWithFileTypesTrue = WalkOptions & { - withFileTypes: true; -}; -export type WalkOptionsWithFileTypesFalse = WalkOptions & { - withFileTypes: false; -}; -/** - * Windows implementation of {@link PathScurryBase} - * - * Defaults to case insensitve, uses `'\\'` to generate path strings. Uses - * {@link PathWin32} for Path objects. - */ -export declare class PathScurryWin32 extends PathScurryBase { - /** - * separator for generating path strings - */ - sep: '\\'; - constructor(cwd?: URL | string, opts?: PathScurryOpts); - /** - * @internal - */ - parseRootPath(dir: string): string; - /** - * @internal - */ - newRoot(fs: FSValue): PathWin32; - /** - * Return true if the provided path string is an absolute path - */ - isAbsolute(p: string): boolean; -} -/** - * {@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. - */ -export declare class PathScurryPosix extends PathScurryBase { - /** - * separator for generating path strings - */ - sep: '/'; - constructor(cwd?: URL | string, opts?: PathScurryOpts); - /** - * @internal - */ - parseRootPath(_dir: string): string; - /** - * @internal - */ - newRoot(fs: FSValue): PathPosix; - /** - * Return true if the provided path string is an absolute path - */ - isAbsolute(p: string): boolean; -} -/** - * {@link PathScurryBase} implementation for Darwin (macOS) systems. - * - * Defaults to case-insensitive matching, uses `'/'` for generating path - * strings. - * - * Uses {@link PathPosix} for Path objects. - */ -export declare class PathScurryDarwin extends PathScurryPosix { - constructor(cwd?: URL | string, opts?: PathScurryOpts); -} -/** - * Default {@link PathBase} implementation for the current platform. - * - * {@link PathWin32} on Windows systems, {@link PathPosix} on all others. - */ -export declare const Path: typeof PathWin32 | typeof PathPosix; -export type Path = PathBase | InstanceType; -/** - * Default {@link PathScurryBase} implementation for the current platform. - * - * {@link PathScurryWin32} on Windows systems, {@link PathScurryDarwin} on - * Darwin (macOS) systems, {@link PathScurryPosix} on all others. - */ -export declare const PathScurry: typeof PathScurryWin32 | typeof PathScurryDarwin | typeof PathScurryPosix; -export type PathScurry = PathScurryBase | InstanceType; -export {}; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/path-scurry/dist/cjs/index.d.ts.map b/node_modules/path-scurry/dist/cjs/index.d.ts.map deleted file mode 100644 index a5f87f2c2b..0000000000 --- a/node_modules/path-scurry/dist/cjs/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,OAAO,QAAQ,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,MAAM,CAAA;AAiBnC,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,IAAI,CAAA;AACvC,OAAO,QAAQ,MAAM,UAAU,CAAA;AAE/B;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,QAAQ;IACvB,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,KAAK,CAAA;IACnC,OAAO,CAAC,EAAE,CACR,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE;QAAE,aAAa,EAAE,IAAI,CAAA;KAAE,EAChC,EAAE,EAAE,CAAC,EAAE,EAAE,MAAM,CAAC,cAAc,GAAG,IAAI,EAAE,OAAO,CAAC,EAAE,MAA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GAAG,OAAO;CAG/B;AAED;;;;;;;GAOG;AACH,qBAAa,gBAAiB,SAAQ,eAAe;gBAEjD,GAAG,GAAE,GAAG,GAAG,MAAsB,EACjC,IAAI,GAAE,cAAmB;CAK5B;AAED;;;;GAIG;AACH,eAAO,MAAM,IAAI,qCAAuD,CAAA;AACxE,MAAM,MAAM,IAAI,GAAG,QAAQ,GAAG,YAAY,CAAC,OAAO,IAAI,CAAC,CAAA;AAEvD;;;;;GAKG;AACH,eAAO,MAAM,UAAU,EACnB,OAAO,eAAe,GACtB,OAAO,gBAAgB,GACvB,OAAO,eAKU,CAAA;AACrB,MAAM,MAAM,UAAU,GAAG,cAAc,GAAG,YAAY,CAAC,OAAO,UAAU,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/path-scurry/dist/cjs/index.js b/node_modules/path-scurry/dist/cjs/index.js deleted file mode 100644 index 54901bd8ae..0000000000 --- a/node_modules/path-scurry/dist/cjs/index.js +++ /dev/null @@ -1,1865 +0,0 @@ -"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 __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.PathScurry = exports.Path = exports.PathScurryDarwin = exports.PathScurryPosix = exports.PathScurryWin32 = exports.PathScurryBase = exports.PathPosix = exports.PathWin32 = exports.PathBase = exports.ChildrenCache = exports.ResolveCache = void 0; -const lru_cache_1 = __importDefault(require("lru-cache")); -const path_1 = require("path"); -const url_1 = require("url"); -const actualFS = __importStar(require("fs")); -const fs_1 = require("fs"); -const realpathSync = fs_1.realpathSync.native; -// TODO: test perf of fs/promises realpath vs realpathCB, -// since the promises one uses realpath.native -const promises_1 = require("fs/promises"); -const minipass_1 = __importDefault(require("minipass")); -const defaultFS = { - lstatSync: fs_1.lstatSync, - readdir: fs_1.readdir, - readdirSync: fs_1.readdirSync, - readlinkSync: fs_1.readlinkSync, - realpathSync, - promises: { - lstat: promises_1.lstat, - readdir: promises_1.readdir, - readlink: promises_1.readlink, - realpath: promises_1.realpath, - }, -}; -// if they just gave us require('fs') then use our default -const fsFromOption = (fsOption) => !fsOption || fsOption === defaultFS || fsOption === actualFS - ? defaultFS - : { - ...defaultFS, - ...fsOption, - promises: { - ...defaultFS.promises, - ...(fsOption.promises || {}), - }, - }; -// turn something like //?/c:/ into c:\ -const uncDriveRegexp = /^\\\\\?\\([a-z]:)\\?$/i; -const uncToDrive = (rootPath) => rootPath.replace(/\//g, '\\').replace(uncDriveRegexp, '$1\\'); -// windows paths are separated by either / or \ -const eitherSep = /[\\\/]/; -const UNKNOWN = 0; // may not even exist, for all we know -const IFIFO = 0b0001; -const IFCHR = 0b0010; -const IFDIR = 0b0100; -const IFBLK = 0b0110; -const IFREG = 0b1000; -const IFLNK = 0b1010; -const IFSOCK = 0b1100; -const IFMT = 0b1111; -// mask to unset low 4 bits -const IFMT_UNKNOWN = ~IFMT; -// set after successfully calling readdir() and getting entries. -const READDIR_CALLED = 16; -// set after a successful lstat() -const LSTAT_CALLED = 32; -// set if an entry (or one of its parents) is definitely not a dir -const ENOTDIR = 64; -// set if an entry (or one of its parents) does not exist -// (can also be set on lstat errors like EACCES or ENAMETOOLONG) -const ENOENT = 128; -// cannot have child entries -- also verify &IFMT is either IFDIR or IFLNK -// set if we fail to readlink -const ENOREADLINK = 256; -// set if we know realpath() will fail -const ENOREALPATH = 512; -const ENOCHILD = ENOTDIR | ENOENT | ENOREALPATH; -const TYPEMASK = 1023; -const entToType = (s) => s.isFile() - ? IFREG - : s.isDirectory() - ? IFDIR - : s.isSymbolicLink() - ? IFLNK - : s.isCharacterDevice() - ? IFCHR - : s.isBlockDevice() - ? IFBLK - : s.isSocket() - ? IFSOCK - : s.isFIFO() - ? IFIFO - : UNKNOWN; -// normalize unicode path names -const normalizeCache = new Map(); -const normalize = (s) => { - const c = normalizeCache.get(s); - if (c) - return c; - const n = s.normalize('NFKD'); - normalizeCache.set(s, n); - return n; -}; -const normalizeNocaseCache = new Map(); -const normalizeNocase = (s) => { - const c = normalizeNocaseCache.get(s); - if (c) - return c; - const n = normalize(s.toLowerCase()); - normalizeNocaseCache.set(s, n); - return n; -}; -/** - * An LRUCache for storing resolved path strings or Path objects. - * @internal - */ -class ResolveCache extends lru_cache_1.default { - constructor() { - super({ max: 256 }); - } -} -exports.ResolveCache = ResolveCache; -// In order to prevent blowing out the js heap by allocating hundreds of -// thousands of Path entries when walking extremely large trees, the "children" -// in this tree are represented by storing an array of Path entries in an -// LRUCache, indexed by the parent. At any time, Path.children() may return an -// empty array, indicating that it doesn't know about any of its children, and -// thus has to rebuild that cache. This is fine, it just means that we don't -// benefit as much from having the cached entries, but huge directory walks -// don't blow out the stack, and smaller ones are still as fast as possible. -// -//It does impose some complexity when building up the readdir data, because we -//need to pass a reference to the children array that we started with. -/** - * an LRUCache for storing child entries. - * @internal - */ -class ChildrenCache extends lru_cache_1.default { - constructor(maxSize = 16 * 1024) { - super({ - maxSize, - // parent + children - sizeCalculation: a => a.length + 1, - }); - } -} -exports.ChildrenCache = ChildrenCache; -/** - * Path objects are sort of like a super-powered - * {@link https://nodejs.org/docs/latest/api/fs.html#class-fsdirent fs.Dirent} - * - * Each one represents a single filesystem entry on disk, which may or may not - * exist. It includes methods for reading various types of information via - * lstat, readlink, and readdir, and caches all information to the greatest - * degree possible. - * - * Note that fs operations that would normally throw will instead return an - * "empty" value. This is in order to prevent excessive overhead from error - * stack traces. - */ -class PathBase { - /** - * 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; - // 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; - #relative; - #type; - #children; - #linkTarget; - #realpath; - /** - * 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.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() - */ - // TODO: instead of taking a param here, set it to '' in the constructor - // for the CWD, and set it to this.name for any roots. - relative() { - 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(); - const rp = pv + (!pv || !p.parent ? '' : this.sep) + name; - return (this.#relative = rp); - } - /** - * 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); - } - /** - * 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. - */ - isUnknown() { - return (this.#type & IFMT) === UNKNOWN; - } - /** - * Is the Path a regular file? - */ - isFile() { - return (this.#type & IFMT) === IFREG; - } - /** - * Is the Path a directory? - */ - isDirectory() { - return (this.#type & IFMT) === IFDIR; - } - /** - * Is the path a character device? - */ - isCharacterDevice() { - return (this.#type & IFMT) === IFCHR; - } - /** - * Is the path a block device? - */ - isBlockDevice() { - return (this.#type & IFMT) === IFBLK; - } - /** - * Is the path a FIFO pipe? - */ - isFIFO() { - return (this.#type & IFMT) === IFIFO; - } - /** - * Is the path a socket? - */ - isSocket() { - return (this.#type & IFMT) === IFSOCK; - } - /** - * Is the path a symbolic link? - */ - isSymbolicLink() { - return (this.#type & IFLNK) === IFLNK; - } - /** - * 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; - } - /** - * 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; - } - /** - * 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; - } - /** - * 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); - } - /** - * 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); - } - /** - * Return true if readdir has previously been successfully called on this - * path, indicating that cachedReaddir() is likely valid. - */ - calledReaddir() { - return !!(this.#type & READDIR_CALLED); - } - /** - * 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. - */ - isENOENT() { - return !!(this.#type & ENOENT); - } - /** - * 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. - */ - isNamed(n) { - return !this.nocase - ? this.#matchName === normalize(n) - : this.#matchName === normalizeNocase(n); - } - /** - * Return the Path object corresponding to the target of a symbolic link. - * - * 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. - */ - async readlink() { - 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 = await this.#fs.promises.readlink(this.fullpath()); - const linkTarget = this.parent.resolve(read); - if (linkTarget) { - return (this.#linkTarget = linkTarget); - } - } - catch (er) { - this.#readlinkFail(er.code); - return undefined; - } - } - /** - * Synchronous {@link PathBase.readlink} - */ - 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.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++) { - children[p].#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; - } - /** - * 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. - */ - 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); - } - } - } - /** - * synchronous {@link PathBase.lstat} - */ - lstatSync() { - if ((this.#type & ENOENT) === 0) { - try { - this.#applyStat(this.#fs.lstatSync(this.fullpath())); - return this; - } - catch (er) { - this.#lstatFail(er.code); - } - } - } - #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; - } - } - #onReaddirCB = []; - #readdirCBInFlight = false; - #callOnReaddirCB(children) { - this.#readdirCBInFlight = false; - const cbs = this.#onReaddirCB.slice(); - this.#onReaddirCB.length = 0; - cbs.forEach(cb => cb(null, children)); - } - /** - * 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. - */ - readdirCB(cb, allowZalgo = false) { - if (!this.canReaddir()) { - if (allowZalgo) - cb(null, []); - else - queueMicrotask(() => cb(null, [])); - return; - } - 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; - /** - * Return an array of known child 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. - */ - 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(); - } - return children.slice(0, children.provisional); - } - /** - * synchronous {@link PathBase.readdir} - */ - readdirSync() { - 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(); - 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))); - } - /** - * 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)); - } - catch (_) { - this.#markENOREALPATH(); - } - } - /** - * 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)); - } - catch (_) { - this.#markENOREALPATH(); - } - } -} -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. - * - * @internal - */ - constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) { - super(name, type, root, roots, nocase, children, opts); - } - /** - * @internal - */ - newChild(name, type = UNKNOWN, opts = {}) { - return new PathWin32(name, type, this.root, this.roots, this.nocase, this.childrenCache(), opts); - } - /** - * @internal - */ - getRootString(path) { - return path_1.win32.parse(path).root; - } - /** - * @internal - */ - 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); - } - /** - * @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; - } -} -exports.PathWin32 = PathWin32; -/** - * Path class used on all posix systems. - * - * Uses `'/'` as the path separator. - */ -class PathPosix extends PathBase { - /** - * separator for parsing path strings - */ - splitSep = '/'; - /** - * 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); - } - /** - * @internal - */ - getRootString(path) { - return path.startsWith('/') ? '/' : ''; - } - /** - * @internal - */ - getRoot(_rootPath) { - return this.root; - } - /** - * @internal - */ - 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 { - /** - * 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; - /** - * A collection of all roots encountered, referenced by rootPath - */ - roots; - /** - * The Path entry corresponding to this PathScurry's current working directory. - */ - cwd; - #resolveCache; - #children; - /** - * Perform path comparisons case-insensitively. - * - * Defaults true on Darwin and Windows systems, false elsewhere. - */ - nocase; - #fs; - /** - * This class should not be instantiated directly. - * - * Use PathScurryWin32, PathScurryDarwin, PathScurryPosix, or PathScurry - * - * @internal - */ - 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, url_1.fileURLToPath)(cwd); - } - // 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.#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 */ - if (nocase === undefined) { - throw new TypeError('must provide nocase setting to PathScurryBase ctor'); - } - /* 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) { - prev = prev.child(part, { - relative: new Array(len--).fill('..').join(joinSep), - fullpath: (abs += (sawFirst ? '' : joinSep) + part), - }); - sawFirst = true; - } - this.cwd = prev; - } - /** - * 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 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; - } - /** - * 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; - } - /** - * 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(); - } - /** - * 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; - } - /** - * 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(); - } - 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); - } - } - 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); - } - } - /** - * 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); - } - return entry.lstat(); - } - /** - * synchronous {@link PathScurryBase.lstat} - */ - lstatSync(entry = this.cwd) { - if (typeof entry === 'string') { - entry = this.cwd.resolve(entry); - } - 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; - } - 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); - } - else if (!(entry instanceof PathBase)) { - withFileTypes = entry.withFileTypes; - entry = this.cwd; - } - 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(); - } - 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(); - } - 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; - } - 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); - }); - }); - } - 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); - } - } - } - 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(); - } - 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](); - } - /** - * Iterating over a PathScurry performs a synchronous walk. - * - * Alias for {@link PathScurryBase.iterateSync} - */ - [Symbol.iterator]() { - return this.iterateSync(); - } - *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); - } - } - } - } - 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.default({ 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); - } - else if (!(entry instanceof PathBase)) { - opts = entry; - entry = this.cwd; - } - const { withFileTypes = true, follow = false, filter, walkFilter, } = opts; - const results = new minipass_1.default({ 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; - } -} -exports.PathScurryBase = PathScurryBase; -/** - * Windows implementation of {@link PathScurryBase} - * - * Defaults to case insensitve, uses `'\\'` to generate path strings. Uses - * {@link PathWin32} for Path objects. - */ -class PathScurryWin32 extends PathScurryBase { - /** - * separator for generating path strings - */ - sep = '\\'; - constructor(cwd = process.cwd(), opts = {}) { - const { nocase = true } = opts; - super(cwd, 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 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)); - } -} -exports.PathScurryWin32 = PathScurryWin32; -/** - * {@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. - */ -class PathScurryPosix extends PathScurryBase { - /** - * separator for generating path strings - */ - sep = '/'; - constructor(cwd = process.cwd(), opts = {}) { - const { nocase = false } = opts; - super(cwd, 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 }); - } - /** - * Return true if the provided path string is an absolute path - */ - 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 \ No newline at end of file diff --git a/node_modules/path-scurry/dist/cjs/index.js.map b/node_modules/path-scurry/dist/cjs/index.js.map deleted file mode 100644 index e0dfe037df..0000000000 --- a/node_modules/path-scurry/dist/cjs/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0DAAgC;AAChC,+BAAmC;AAEnC,6BAAmC;AAEnC,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AI,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAA;AAGxE;;;;;GAKG;AACU,QAAA,UAAU,GAIrB,OAAO,CAAC,QAAQ,KAAK,OAAO;IAC1B,CAAC,CAAC,eAAe;IACjB,CAAC,CAAC,OAAO,CAAC,QAAQ,KAAK,QAAQ;QAC/B,CAAC,CAAC,gBAAgB;QAClB,CAAC,CAAC,eAAe,CAAA"} \ No newline at end of file diff --git a/node_modules/path-scurry/dist/cjs/package.json b/node_modules/path-scurry/dist/cjs/package.json deleted file mode 100644 index 5bbefffbab..0000000000 --- a/node_modules/path-scurry/dist/cjs/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "commonjs" -} diff --git a/node_modules/path-scurry/dist/mjs/index.d.ts b/node_modules/path-scurry/dist/mjs/index.d.ts deleted file mode 100644 index 7ff22c2d7f..0000000000 --- a/node_modules/path-scurry/dist/mjs/index.d.ts +++ /dev/null @@ -1,1055 +0,0 @@ -/// -/// -/// -import LRUCache from 'lru-cache'; -import { posix, win32 } from 'path'; -import type { Dirent, Stats } from 'fs'; -import Minipass from 'minipass'; -/** - * An object that will be used to override the default `fs` - * methods. Any methods that are not overridden will use Node's - * built-in implementations. - * - * - lstatSync - * - readdir (callback `withFileTypes` Dirent variant, used for - * readdirCB and most walks) - * - readdirSync - * - readlinkSync - * - realpathSync - * - promises: Object containing the following async methods: - * - lstat - * - readdir (Dirent variant only) - * - readlink - * - realpath - */ -export interface FSOption { - lstatSync?: (path: string) => Stats; - readdir?: (path: string, options: { - withFileTypes: true; - }, cb: (er: NodeJS.ErrnoException | null, entries?: Dirent[]) => any) => void; - readdirSync?: (path: string, options: { - withFileTypes: true; - }) => Dirent[]; - readlinkSync?: (path: string) => string; - realpathSync?: (path: string) => string; - promises?: { - lstat?: (path: string) => Promise; - readdir?: (path: string, options: { - withFileTypes: true; - }) => Promise; - readlink?: (path: string) => Promise; - realpath?: (path: string) => Promise; - [k: string]: any; - }; - [k: string]: any; -} -interface FSValue { - lstatSync: (path: string) => Stats; - readdir: (path: string, options: { - withFileTypes: true; - }, cb: (er: NodeJS.ErrnoException | null, entries?: Dirent[]) => any) => void; - readdirSync: (path: string, options: { - withFileTypes: true; - }) => Dirent[]; - readlinkSync: (path: string) => string; - realpathSync: (path: string) => string; - promises: { - lstat: (path: string) => Promise; - readdir: (path: string, options: { - withFileTypes: true; - }) => Promise; - readlink: (path: string) => Promise; - realpath: (path: string) => Promise; - [k: string]: any; - }; - [k: string]: any; -} -/** - * Options that may be provided to the Path constructor - */ -export interface PathOpts { - fullpath?: string; - relative?: string; - parent?: PathBase; - /** - * See {@link FSOption} - */ - fs?: FSOption; -} -/** - * An LRUCache for storing resolved path strings or Path objects. - * @internal - */ -export declare class ResolveCache extends LRUCache { - constructor(); -} -/** - * an LRUCache for storing child entries. - * @internal - */ -export declare class ChildrenCache extends LRUCache { - constructor(maxSize?: number); -} -/** - * Array of Path objects, plus a marker indicating the first provisional entry - * - * @internal - */ -export type Children = PathBase[] & { - provisional: number; -}; -/** - * Path objects are sort of like a super-powered - * {@link https://nodejs.org/docs/latest/api/fs.html#class-fsdirent fs.Dirent} - * - * Each one represents a single filesystem entry on disk, which may or may not - * exist. It includes methods for reading various types of information via - * lstat, readlink, and readdir, and caches all information to the greatest - * degree possible. - * - * Note that fs operations that would normally throw will instead return an - * "empty" value. This is in order to prevent excessive overhead from error - * stack traces. - */ -export declare abstract class PathBase implements Dirent { - #private; - /** - * 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: string; - /** - * the Path entry corresponding to the path root. - * - * @internal - */ - root: PathBase; - /** - * All roots found within the current PathScurry family - * - * @internal - */ - roots: { - [k: string]: PathBase; - }; - /** - * a reference to the parent path, or undefined in the case of root entries - * - * @internal - */ - parent?: PathBase; - /** - * boolean indicating whether paths are compared case-insensitively - * @internal - */ - nocase: boolean; - /** - * the string or regexp used to split paths. On posix, it is `'/'`, and on - * windows it is a RegExp matching either `'/'` or `'\\'` - */ - abstract splitSep: string | RegExp; - /** - * The path separator string to use when joining paths - */ - abstract sep: string; - get dev(): number | undefined; - get mode(): number | undefined; - get nlink(): number | undefined; - get uid(): number | undefined; - get gid(): number | undefined; - get rdev(): number | undefined; - get blksize(): number | undefined; - get ino(): number | undefined; - get size(): number | undefined; - get blocks(): number | undefined; - get atimeMs(): number | undefined; - get mtimeMs(): number | undefined; - get ctimeMs(): number | undefined; - get birthtimeMs(): number | undefined; - get atime(): Date | undefined; - get mtime(): Date | undefined; - get ctime(): Date | undefined; - get birthtime(): Date | undefined; - /** - * 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: string, type: number | undefined, root: PathBase | undefined, roots: { - [k: string]: PathBase; - }, nocase: boolean, children: ChildrenCache, opts: PathOpts); - /** - * Returns the depth of the Path object from its root. - * - * For example, a path at `/foo/bar` would have a depth of 2. - */ - depth(): number; - /** - * @internal - */ - abstract getRootString(path: string): string; - /** - * @internal - */ - abstract getRoot(rootPath: string): PathBase; - /** - * @internal - */ - abstract newChild(name: string, type?: number, opts?: PathOpts): PathBase; - /** - * @internal - */ - childrenCache(): ChildrenCache; - /** - * Get the Path object referenced by the string path, resolved from this Path - */ - resolve(path?: string): PathBase; - /** - * 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(): 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: string, opts?: PathOpts): PathBase; - /** - * 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(): string; - /** - * The fully resolved path string for this Path entry - */ - fullpath(): string; - /** - * 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. - */ - isUnknown(): boolean; - /** - * Is the Path a regular file? - */ - isFile(): boolean; - /** - * Is the Path a directory? - */ - isDirectory(): boolean; - /** - * Is the path a character device? - */ - isCharacterDevice(): boolean; - /** - * Is the path a block device? - */ - isBlockDevice(): boolean; - /** - * Is the path a FIFO pipe? - */ - isFIFO(): boolean; - /** - * Is the path a socket? - */ - isSocket(): boolean; - /** - * Is the path a symbolic link? - */ - isSymbolicLink(): boolean; - /** - * 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(): PathBase | undefined; - /** - * 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(): PathBase | undefined; - /** - * 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(): PathBase | undefined; - /** - * 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(): PathBase[]; - /** - * 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(): boolean; - /** - * Return true if readdir has previously been successfully called on this - * path, indicating that cachedReaddir() is likely valid. - */ - calledReaddir(): boolean; - /** - * 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. - */ - isENOENT(): boolean; - /** - * 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. - */ - isNamed(n: string): boolean; - /** - * Return the Path object corresponding to the target of a symbolic link. - * - * 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. - */ - readlink(): Promise; - /** - * Synchronous {@link PathBase.readlink} - */ - readlinkSync(): PathBase | undefined; - /** - * 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. - */ - lstat(): Promise; - /** - * synchronous {@link PathBase.lstat} - */ - lstatSync(): PathBase | undefined; - /** - * 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. - */ - readdirCB(cb: (er: NodeJS.ErrnoException | null, entries: PathBase[]) => any, allowZalgo?: boolean): void; - /** - * Return an array of known child 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. - */ - readdir(): Promise; - /** - * synchronous {@link PathBase.readdir} - */ - readdirSync(): PathBase[]; - canReaddir(): boolean; - shouldWalk(dirs: Set, walkFilter?: (e: PathBase) => boolean): boolean; - /** - * 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. - */ - realpath(): Promise; - /** - * Synchronous {@link realpath} - */ - realpathSync(): PathBase | undefined; -} -/** - * Path class used on win32 systems - * - * Uses `'\\'` as the path separator for returned paths, either `'\\'` or `'/'` - * as the path separator for parsing paths. - */ -export declare class PathWin32 extends PathBase { - /** - * Separator for generating path strings. - */ - sep: '\\'; - /** - * Separator for parsing path strings. - */ - splitSep: RegExp; - /** - * 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: string, type: number | undefined, root: PathBase | undefined, roots: { - [k: string]: PathBase; - }, nocase: boolean, children: ChildrenCache, opts: PathOpts); - /** - * @internal - */ - newChild(name: string, type?: number, opts?: PathOpts): PathWin32; - /** - * @internal - */ - getRootString(path: string): string; - /** - * @internal - */ - getRoot(rootPath: string): PathBase; - /** - * @internal - */ - sameRoot(rootPath: string, compare?: string): boolean; -} -/** - * Path class used on all posix systems. - * - * Uses `'/'` as the path separator. - */ -export declare class PathPosix extends PathBase { - /** - * separator for parsing path strings - */ - splitSep: '/'; - /** - * 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: string, type: number | undefined, root: PathBase | undefined, roots: { - [k: string]: PathBase; - }, nocase: boolean, children: ChildrenCache, opts: PathOpts); - /** - * @internal - */ - getRootString(path: string): string; - /** - * @internal - */ - getRoot(_rootPath: string): PathBase; - /** - * @internal - */ - newChild(name: string, type?: number, opts?: PathOpts): PathPosix; -} -/** - * Options that may be provided to the PathScurry constructor - */ -export interface PathScurryOpts { - /** - * perform case-insensitive path matching. Default based on platform - * subclass. - */ - nocase?: boolean; - /** - * Number of Path entries to keep in the cache of Path child references. - * - * Setting this higher than 65536 will dramatically increase the data - * consumption and construction time overhead of each PathScurry. - * - * Setting this value to 256 or lower will significantly reduce the data - * consumption and construction time overhead, but may also reduce resolve() - * and readdir() performance on large filesystems. - * - * Default `16384`. - */ - childrenCacheSize?: number; - /** - * An object that overrides the built-in functions from the fs and - * fs/promises modules. - * - * See {@link FSOption} - */ - fs?: FSOption; -} -/** - * 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. - */ -export declare abstract class PathScurryBase { - #private; - /** - * The root Path entry for the current working directory of this Scurry - */ - root: PathBase; - /** - * The string path for the root of this Scurry's current working directory - */ - rootPath: string; - /** - * A collection of all roots encountered, referenced by rootPath - */ - roots: { - [k: string]: PathBase; - }; - /** - * The Path entry corresponding to this PathScurry's current working directory. - */ - cwd: PathBase; - /** - * Perform path comparisons case-insensitively. - * - * Defaults true on Darwin and Windows systems, false elsewhere. - */ - nocase: boolean; - /** - * The path separator used for parsing paths - * - * `'/'` on Posix systems, either `'/'` or `'\\'` on Windows - */ - abstract sep: string | RegExp; - /** - * This class should not be instantiated directly. - * - * Use PathScurryWin32, PathScurryDarwin, PathScurryPosix, or PathScurry - * - * @internal - */ - constructor(cwd: string | URL | undefined, pathImpl: typeof win32 | typeof posix, sep: string | RegExp, { nocase, childrenCacheSize, fs, }?: PathScurryOpts); - /** - * Get the depth of a provided path, string, or the cwd - */ - depth(path?: Path | string): number; - /** - * Parse the root portion of a path string - * - * @internal - */ - abstract parseRootPath(dir: string): string; - /** - * create a new Path to use as root during construction. - * - * @internal - */ - abstract newRoot(fs: FSValue): PathBase; - /** - * Determine whether a given path string is absolute - */ - abstract isAbsolute(p: string): boolean; - /** - * Return the cache of child entries. Exposed so subclasses can create - * child Path objects in a platform-specific way. - * - * @internal - */ - childrenCache(): ChildrenCache; - /** - * 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: string[]): string; - /** - * find the relative path from the cwd to the supplied path string or entry - */ - relative(entry?: PathBase | string): string; - /** - * Return the basename for the provided string or Path object - */ - basename(entry?: PathBase | string): string; - /** - * Return the dirname for the provided string or Path object - */ - dirname(entry?: PathBase | string): string; - /** - * Return an array of known child entries. - * - * First argument may be either a string, or a Path object. - * - * 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. - * - * Unlike `fs.readdir()`, the `withFileTypes` option defaults to `true`. Set - * `{ withFileTypes: false }` to return strings. - */ - readdir(): Promise; - readdir(opts: { - withFileTypes: true; - }): Promise; - readdir(opts: { - withFileTypes: false; - }): Promise; - readdir(opts: { - withFileTypes: boolean; - }): Promise; - readdir(entry: PathBase | string): Promise; - readdir(entry: PathBase | string, opts: { - withFileTypes: true; - }): Promise; - readdir(entry: PathBase | string, opts: { - withFileTypes: false; - }): Promise; - readdir(entry: PathBase | string, opts: { - withFileTypes: boolean; - }): Promise; - /** - * synchronous {@link PathScurryBase.readdir} - */ - readdirSync(): PathBase[]; - readdirSync(opts: { - withFileTypes: true; - }): PathBase[]; - readdirSync(opts: { - withFileTypes: false; - }): string[]; - readdirSync(opts: { - withFileTypes: boolean; - }): PathBase[] | string[]; - readdirSync(entry: PathBase | string): PathBase[]; - readdirSync(entry: PathBase | string, opts: { - withFileTypes: true; - }): PathBase[]; - readdirSync(entry: PathBase | string, opts: { - withFileTypes: false; - }): string[]; - readdirSync(entry: PathBase | string, opts: { - withFileTypes: boolean; - }): PathBase[] | string[]; - /** - * 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. - */ - lstat(entry?: string | PathBase): Promise; - /** - * synchronous {@link PathScurryBase.lstat} - */ - lstatSync(entry?: string | PathBase): PathBase | undefined; - /** - * Return the Path object or string path corresponding to the target of a - * symbolic link. - * - * 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. - * - * `{withFileTypes}` option defaults to `false`. - * - * On success, returns a Path object if `withFileTypes` option is true, - * otherwise a string. - */ - readlink(): Promise; - readlink(opt: { - withFileTypes: false; - }): Promise; - readlink(opt: { - withFileTypes: true; - }): Promise; - readlink(opt: { - withFileTypes: boolean; - }): Promise; - readlink(entry: string | PathBase, opt?: { - withFileTypes: false; - }): Promise; - readlink(entry: string | PathBase, opt: { - withFileTypes: true; - }): Promise; - readlink(entry: string | PathBase, opt: { - withFileTypes: boolean; - }): Promise; - /** - * synchronous {@link PathScurryBase.readlink} - */ - readlinkSync(): string | undefined; - readlinkSync(opt: { - withFileTypes: false; - }): string | undefined; - readlinkSync(opt: { - withFileTypes: true; - }): PathBase | undefined; - readlinkSync(opt: { - withFileTypes: boolean; - }): PathBase | string | undefined; - readlinkSync(entry: string | PathBase, opt?: { - withFileTypes: false; - }): string | undefined; - readlinkSync(entry: string | PathBase, opt: { - withFileTypes: true; - }): PathBase | undefined; - readlinkSync(entry: string | PathBase, opt: { - withFileTypes: boolean; - }): string | PathBase | undefined; - /** - * Return the Path object or string path 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. - * - * `{withFileTypes}` option defaults to `false`. - * - * On success, returns a Path object if `withFileTypes` option is true, - * otherwise a string. - */ - realpath(): Promise; - realpath(opt: { - withFileTypes: false; - }): Promise; - realpath(opt: { - withFileTypes: true; - }): Promise; - realpath(opt: { - withFileTypes: boolean; - }): Promise; - realpath(entry: string | PathBase, opt?: { - withFileTypes: false; - }): Promise; - realpath(entry: string | PathBase, opt: { - withFileTypes: true; - }): Promise; - realpath(entry: string | PathBase, opt: { - withFileTypes: boolean; - }): Promise; - realpathSync(): string | undefined; - realpathSync(opt: { - withFileTypes: false; - }): string | undefined; - realpathSync(opt: { - withFileTypes: true; - }): PathBase | undefined; - realpathSync(opt: { - withFileTypes: boolean; - }): PathBase | string | undefined; - realpathSync(entry: string | PathBase, opt?: { - withFileTypes: false; - }): string | undefined; - realpathSync(entry: string | PathBase, opt: { - withFileTypes: true; - }): PathBase | undefined; - realpathSync(entry: string | PathBase, opt: { - withFileTypes: boolean; - }): string | PathBase | undefined; - /** - * Asynchronously walk the directory tree, returning an array of - * all path strings or Path objects found. - * - * Note that this will be extremely memory-hungry on large filesystems. - * In such cases, it may be better to use the stream or async iterator - * walk implementation. - */ - walk(): Promise; - walk(opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): Promise; - walk(opts: WalkOptionsWithFileTypesFalse): Promise; - walk(opts: WalkOptions): Promise; - walk(entry: string | PathBase): Promise; - walk(entry: string | PathBase, opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): Promise; - walk(entry: string | PathBase, opts: WalkOptionsWithFileTypesFalse): Promise; - walk(entry: string | PathBase, opts: WalkOptions): Promise; - /** - * Synchronously walk the directory tree, returning an array of - * all path strings or Path objects found. - * - * Note that this will be extremely memory-hungry on large filesystems. - * In such cases, it may be better to use the stream or async iterator - * walk implementation. - */ - walkSync(): PathBase[]; - walkSync(opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): PathBase[]; - walkSync(opts: WalkOptionsWithFileTypesFalse): string[]; - walkSync(opts: WalkOptions): string[] | PathBase[]; - walkSync(entry: string | PathBase): PathBase[]; - walkSync(entry: string | PathBase, opts: WalkOptionsWithFileTypesUnset | WalkOptionsWithFileTypesTrue): PathBase[]; - walkSync(entry: string | PathBase, opts: WalkOptionsWithFileTypesFalse): string[]; - walkSync(entry: string | PathBase, opts: WalkOptions): PathBase[] | string[]; - /** - * 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](): AsyncGenerator; - /** - * Async generator form of {@link PathScurryBase.walk} - * - * Note: As of Node 19, this is very slow, compared to other methods of - * walking, especially if most/all of the directory tree has been previously - * walked. Consider using {@link PathScurryBase.stream} if memory overhead - * and backpressure are concerns, or {@link PathScurryBase.walk} if not. - */ - iterate(): AsyncGenerator; - iterate(opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): AsyncGenerator; - iterate(opts: WalkOptionsWithFileTypesFalse): AsyncGenerator; - iterate(opts: WalkOptions): AsyncGenerator; - iterate(entry: string | PathBase): AsyncGenerator; - iterate(entry: string | PathBase, opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): AsyncGenerator; - iterate(entry: string | PathBase, opts: WalkOptionsWithFileTypesFalse): AsyncGenerator; - iterate(entry: string | PathBase, opts: WalkOptions): AsyncGenerator; - /** - * Iterating over a PathScurry performs a synchronous walk. - * - * Alias for {@link PathScurryBase.iterateSync} - */ - [Symbol.iterator](): Generator; - iterateSync(): Generator; - iterateSync(opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): Generator; - iterateSync(opts: WalkOptionsWithFileTypesFalse): Generator; - iterateSync(opts: WalkOptions): Generator; - iterateSync(entry: string | PathBase): Generator; - iterateSync(entry: string | PathBase, opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): Generator; - iterateSync(entry: string | PathBase, opts: WalkOptionsWithFileTypesFalse): Generator; - iterateSync(entry: string | PathBase, opts: WalkOptions): Generator; - /** - * Stream form of {@link PathScurryBase.walk} - * - * Returns a Minipass stream that emits {@link PathBase} objects by default, - * or strings if `{ withFileTypes: false }` is set in the options. - */ - stream(): Minipass; - stream(opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): Minipass; - stream(opts: WalkOptionsWithFileTypesFalse): Minipass; - stream(opts: WalkOptions): Minipass; - stream(entry: string | PathBase): Minipass; - stream(entry: string | PathBase, opts: WalkOptionsWithFileTypesUnset | WalkOptionsWithFileTypesTrue): Minipass; - stream(entry: string | PathBase, opts: WalkOptionsWithFileTypesFalse): Minipass; - stream(entry: string | PathBase, opts: WalkOptions): Minipass | Minipass; - /** - * Synchronous form of {@link PathScurryBase.stream} - * - * Returns a Minipass stream that emits {@link PathBase} objects by default, - * or strings if `{ withFileTypes: false }` is set in the options. - * - * Will complete the walk in a single tick if the stream is consumed fully. - * Otherwise, will pause as needed for stream backpressure. - */ - streamSync(): Minipass; - streamSync(opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): Minipass; - streamSync(opts: WalkOptionsWithFileTypesFalse): Minipass; - streamSync(opts: WalkOptions): Minipass; - streamSync(entry: string | PathBase): Minipass; - streamSync(entry: string | PathBase, opts: WalkOptionsWithFileTypesUnset | WalkOptionsWithFileTypesTrue): Minipass; - streamSync(entry: string | PathBase, opts: WalkOptionsWithFileTypesFalse): Minipass; - streamSync(entry: string | PathBase, opts: WalkOptions): Minipass | Minipass; -} -/** - * Options provided to all walk methods. - */ -export interface WalkOptions { - /** - * Return results as {@link PathBase} objects rather than strings. - * When set to false, results are fully resolved paths, as returned by - * {@link PathBase.fullpath}. - * @default true - */ - withFileTypes?: boolean; - /** - * Attempt to read directory entries from symbolic links. Otherwise, only - * actual directories are traversed. Regardless of this setting, a given - * target path will only ever be walked once, meaning that a symbolic link - * to a previously traversed directory will never be followed. - * - * Setting this imposes a slight performance penalty, because `readlink` - * must be called on all symbolic links encountered, in order to avoid - * infinite cycles. - * @default false - */ - follow?: boolean; - /** - * Only return entries where the provided function returns true. - * - * This will not prevent directories from being traversed, even if they do - * not pass the filter, though it will prevent directories themselves from - * being included in the result set. See {@link walkFilter} - * - * Asynchronous functions are not supported here. - * - * By default, if no filter is provided, all entries and traversed - * directories are included. - */ - filter?: (entry: PathBase) => boolean; - /** - * Only traverse directories (and in the case of {@link follow} being set to - * true, symbolic links to directories) if the provided function returns - * true. - * - * This will not prevent directories from being included in the result set, - * even if they do not pass the supplied filter function. See {@link filter} - * to do that. - * - * Asynchronous functions are not supported here. - */ - walkFilter?: (entry: PathBase) => boolean; -} -export type WalkOptionsWithFileTypesUnset = WalkOptions & { - withFileTypes?: undefined; -}; -export type WalkOptionsWithFileTypesTrue = WalkOptions & { - withFileTypes: true; -}; -export type WalkOptionsWithFileTypesFalse = WalkOptions & { - withFileTypes: false; -}; -/** - * Windows implementation of {@link PathScurryBase} - * - * Defaults to case insensitve, uses `'\\'` to generate path strings. Uses - * {@link PathWin32} for Path objects. - */ -export declare class PathScurryWin32 extends PathScurryBase { - /** - * separator for generating path strings - */ - sep: '\\'; - constructor(cwd?: URL | string, opts?: PathScurryOpts); - /** - * @internal - */ - parseRootPath(dir: string): string; - /** - * @internal - */ - newRoot(fs: FSValue): PathWin32; - /** - * Return true if the provided path string is an absolute path - */ - isAbsolute(p: string): boolean; -} -/** - * {@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. - */ -export declare class PathScurryPosix extends PathScurryBase { - /** - * separator for generating path strings - */ - sep: '/'; - constructor(cwd?: URL | string, opts?: PathScurryOpts); - /** - * @internal - */ - parseRootPath(_dir: string): string; - /** - * @internal - */ - newRoot(fs: FSValue): PathPosix; - /** - * Return true if the provided path string is an absolute path - */ - isAbsolute(p: string): boolean; -} -/** - * {@link PathScurryBase} implementation for Darwin (macOS) systems. - * - * Defaults to case-insensitive matching, uses `'/'` for generating path - * strings. - * - * Uses {@link PathPosix} for Path objects. - */ -export declare class PathScurryDarwin extends PathScurryPosix { - constructor(cwd?: URL | string, opts?: PathScurryOpts); -} -/** - * Default {@link PathBase} implementation for the current platform. - * - * {@link PathWin32} on Windows systems, {@link PathPosix} on all others. - */ -export declare const Path: typeof PathWin32 | typeof PathPosix; -export type Path = PathBase | InstanceType; -/** - * Default {@link PathScurryBase} implementation for the current platform. - * - * {@link PathScurryWin32} on Windows systems, {@link PathScurryDarwin} on - * Darwin (macOS) systems, {@link PathScurryPosix} on all others. - */ -export declare const PathScurry: typeof PathScurryWin32 | typeof PathScurryDarwin | typeof PathScurryPosix; -export type PathScurry = PathScurryBase | InstanceType; -export {}; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/path-scurry/dist/mjs/index.d.ts.map b/node_modules/path-scurry/dist/mjs/index.d.ts.map deleted file mode 100644 index a5f87f2c2b..0000000000 --- a/node_modules/path-scurry/dist/mjs/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,OAAO,QAAQ,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,MAAM,CAAA;AAiBnC,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,IAAI,CAAA;AACvC,OAAO,QAAQ,MAAM,UAAU,CAAA;AAE/B;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,QAAQ;IACvB,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,KAAK,CAAA;IACnC,OAAO,CAAC,EAAE,CACR,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE;QAAE,aAAa,EAAE,IAAI,CAAA;KAAE,EAChC,EAAE,EAAE,CAAC,EAAE,EAAE,MAAM,CAAC,cAAc,GAAG,IAAI,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,GAAG,KAC9D,IAAI,CAAA;IACT,WAAW,CAAC,EAAE,CACZ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Ae;gBAEjD,GAAG,GAAE,GAAG,GAAG,MAAsB,EACjC,IAAI,GAAE,cAAmB;CAK5B;AAED;;;;GAIG;AACH,eAAO,MAAM,IAAI,qCAAuD,CAAA;AACxE,MAAM,MAAM,IAAI,GAAG,QAAQ,GAAG,YAAY,CAAC,OAAO,IAAI,CAAC,CAAA;AAEvD;;;;;GAKG;AACH,eAAO,MAAM,UAAU,EACnB,OAAO,eAAe,GACtB,OAAO,gBAAgB,GACvB,OAAO,eAKU,CAAA;AACrB,MAAM,MAAM,UAAU,GAAG,cAAc,GAAG,YAAY,CAAC,OAAO,UAAU,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/path-scurry/dist/mjs/index.js b/node_modules/path-scurry/dist/mjs/index.js deleted file mode 100644 index b6a2cf9c8a..0000000000 --- a/node_modules/path-scurry/dist/mjs/index.js +++ /dev/null @@ -1,1827 +0,0 @@ -import LRUCache from 'lru-cache'; -import { posix, win32 } from 'path'; -import { fileURLToPath } from 'url'; -import * as actualFS from 'fs'; -import { lstatSync, readdir as readdirCB, readdirSync, readlinkSync, realpathSync as rps, } from 'fs'; -const realpathSync = rps.native; -// TODO: test perf of fs/promises realpath vs realpathCB, -// since the promises one uses realpath.native -import { lstat, readdir, readlink, realpath } from 'fs/promises'; -import Minipass from 'minipass'; -const defaultFS = { - lstatSync, - readdir: readdirCB, - readdirSync, - readlinkSync, - realpathSync, - promises: { - lstat, - readdir, - readlink, - realpath, - }, -}; -// if they just gave us require('fs') then use our default -const fsFromOption = (fsOption) => !fsOption || fsOption === defaultFS || fsOption === actualFS - ? defaultFS - : { - ...defaultFS, - ...fsOption, - promises: { - ...defaultFS.promises, - ...(fsOption.promises || {}), - }, - }; -// turn something like //?/c:/ into c:\ -const uncDriveRegexp = /^\\\\\?\\([a-z]:)\\?$/i; -const uncToDrive = (rootPath) => rootPath.replace(/\//g, '\\').replace(uncDriveRegexp, '$1\\'); -// windows paths are separated by either / or \ -const eitherSep = /[\\\/]/; -const UNKNOWN = 0; // may not even exist, for all we know -const IFIFO = 0b0001; -const IFCHR = 0b0010; -const IFDIR = 0b0100; -const IFBLK = 0b0110; -const IFREG = 0b1000; -const IFLNK = 0b1010; -const IFSOCK = 0b1100; -const IFMT = 0b1111; -// mask to unset low 4 bits -const IFMT_UNKNOWN = ~IFMT; -// set after successfully calling readdir() and getting entries. -const READDIR_CALLED = 16; -// set after a successful lstat() -const LSTAT_CALLED = 32; -// set if an entry (or one of its parents) is definitely not a dir -const ENOTDIR = 64; -// set if an entry (or one of its parents) does not exist -// (can also be set on lstat errors like EACCES or ENAMETOOLONG) -const ENOENT = 128; -// cannot have child entries -- also verify &IFMT is either IFDIR or IFLNK -// set if we fail to readlink -const ENOREADLINK = 256; -// set if we know realpath() will fail -const ENOREALPATH = 512; -const ENOCHILD = ENOTDIR | ENOENT | ENOREALPATH; -const TYPEMASK = 1023; -const entToType = (s) => s.isFile() - ? IFREG - : s.isDirectory() - ? IFDIR - : s.isSymbolicLink() - ? IFLNK - : s.isCharacterDevice() - ? IFCHR - : s.isBlockDevice() - ? IFBLK - : s.isSocket() - ? IFSOCK - : s.isFIFO() - ? IFIFO - : UNKNOWN; -// normalize unicode path names -const normalizeCache = new Map(); -const normalize = (s) => { - const c = normalizeCache.get(s); - if (c) - return c; - const n = s.normalize('NFKD'); - normalizeCache.set(s, n); - return n; -}; -const normalizeNocaseCache = new Map(); -const normalizeNocase = (s) => { - const c = normalizeNocaseCache.get(s); - if (c) - return c; - const n = normalize(s.toLowerCase()); - normalizeNocaseCache.set(s, n); - return n; -}; -/** - * An LRUCache for storing resolved path strings or Path objects. - * @internal - */ -export class ResolveCache extends LRUCache { - constructor() { - super({ max: 256 }); - } -} -// In order to prevent blowing out the js heap by allocating hundreds of -// thousands of Path entries when walking extremely large trees, the "children" -// in this tree are represented by storing an array of Path entries in an -// LRUCache, indexed by the parent. At any time, Path.children() may return an -// empty array, indicating that it doesn't know about any of its children, and -// thus has to rebuild that cache. This is fine, it just means that we don't -// benefit as much from having the cached entries, but huge directory walks -// don't blow out the stack, and smaller ones are still as fast as possible. -// -//It does impose some complexity when building up the readdir data, because we -//need to pass a reference to the children array that we started with. -/** - * an LRUCache for storing child entries. - * @internal - */ -export class ChildrenCache extends LRUCache { - constructor(maxSize = 16 * 1024) { - super({ - maxSize, - // parent + children - sizeCalculation: a => a.length + 1, - }); - } -} -/** - * Path objects are sort of like a super-powered - * {@link https://nodejs.org/docs/latest/api/fs.html#class-fsdirent fs.Dirent} - * - * Each one represents a single filesystem entry on disk, which may or may not - * exist. It includes methods for reading various types of information via - * lstat, readlink, and readdir, and caches all information to the greatest - * degree possible. - * - * Note that fs operations that would normally throw will instead return an - * "empty" value. This is in order to prevent excessive overhead from error - * stack traces. - */ -export class PathBase { - /** - * 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; - // 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; - #relative; - #type; - #children; - #linkTarget; - #realpath; - /** - * 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.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() - */ - // TODO: instead of taking a param here, set it to '' in the constructor - // for the CWD, and set it to this.name for any roots. - relative() { - 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(); - const rp = pv + (!pv || !p.parent ? '' : this.sep) + name; - return (this.#relative = rp); - } - /** - * 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); - } - /** - * 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. - */ - isUnknown() { - return (this.#type & IFMT) === UNKNOWN; - } - /** - * Is the Path a regular file? - */ - isFile() { - return (this.#type & IFMT) === IFREG; - } - /** - * Is the Path a directory? - */ - isDirectory() { - return (this.#type & IFMT) === IFDIR; - } - /** - * Is the path a character device? - */ - isCharacterDevice() { - return (this.#type & IFMT) === IFCHR; - } - /** - * Is the path a block device? - */ - isBlockDevice() { - return (this.#type & IFMT) === IFBLK; - } - /** - * Is the path a FIFO pipe? - */ - isFIFO() { - return (this.#type & IFMT) === IFIFO; - } - /** - * Is the path a socket? - */ - isSocket() { - return (this.#type & IFMT) === IFSOCK; - } - /** - * Is the path a symbolic link? - */ - isSymbolicLink() { - return (this.#type & IFLNK) === IFLNK; - } - /** - * 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; - } - /** - * 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; - } - /** - * 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; - } - /** - * 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); - } - /** - * 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); - } - /** - * Return true if readdir has previously been successfully called on this - * path, indicating that cachedReaddir() is likely valid. - */ - calledReaddir() { - return !!(this.#type & READDIR_CALLED); - } - /** - * 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. - */ - isENOENT() { - return !!(this.#type & ENOENT); - } - /** - * 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. - */ - isNamed(n) { - return !this.nocase - ? this.#matchName === normalize(n) - : this.#matchName === normalizeNocase(n); - } - /** - * Return the Path object corresponding to the target of a symbolic link. - * - * 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. - */ - async readlink() { - 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 = await this.#fs.promises.readlink(this.fullpath()); - const linkTarget = this.parent.resolve(read); - if (linkTarget) { - return (this.#linkTarget = linkTarget); - } - } - catch (er) { - this.#readlinkFail(er.code); - return undefined; - } - } - /** - * Synchronous {@link PathBase.readlink} - */ - 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.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++) { - children[p].#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; - } - /** - * 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. - */ - 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); - } - } - } - /** - * synchronous {@link PathBase.lstat} - */ - lstatSync() { - if ((this.#type & ENOENT) === 0) { - try { - this.#applyStat(this.#fs.lstatSync(this.fullpath())); - return this; - } - catch (er) { - this.#lstatFail(er.code); - } - } - } - #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; - } - } - #onReaddirCB = []; - #readdirCBInFlight = false; - #callOnReaddirCB(children) { - this.#readdirCBInFlight = false; - const cbs = this.#onReaddirCB.slice(); - this.#onReaddirCB.length = 0; - cbs.forEach(cb => cb(null, children)); - } - /** - * 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. - */ - readdirCB(cb, allowZalgo = false) { - if (!this.canReaddir()) { - if (allowZalgo) - cb(null, []); - else - queueMicrotask(() => cb(null, [])); - return; - } - 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; - /** - * Return an array of known child 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. - */ - 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(); - } - return children.slice(0, children.provisional); - } - /** - * synchronous {@link PathBase.readdir} - */ - readdirSync() { - 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(); - 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))); - } - /** - * 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)); - } - catch (_) { - this.#markENOREALPATH(); - } - } - /** - * 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)); - } - catch (_) { - this.#markENOREALPATH(); - } - } -} -/** - * Path class used on win32 systems - * - * Uses `'\\'` as the path separator for returned paths, either `'\\'` or `'/'` - * as the path separator for parsing paths. - */ -export 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. - * - * @internal - */ - constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) { - super(name, type, root, roots, nocase, children, opts); - } - /** - * @internal - */ - newChild(name, type = UNKNOWN, opts = {}) { - return new PathWin32(name, type, this.root, this.roots, this.nocase, this.childrenCache(), opts); - } - /** - * @internal - */ - getRootString(path) { - return win32.parse(path).root; - } - /** - * @internal - */ - 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); - } - /** - * @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; - } -} -/** - * Path class used on all posix systems. - * - * Uses `'/'` as the path separator. - */ -export class PathPosix extends PathBase { - /** - * separator for parsing path strings - */ - splitSep = '/'; - /** - * 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); - } - /** - * @internal - */ - getRootString(path) { - return path.startsWith('/') ? '/' : ''; - } - /** - * @internal - */ - getRoot(_rootPath) { - return this.root; - } - /** - * @internal - */ - newChild(name, type = UNKNOWN, opts = {}) { - return new PathPosix(name, type, this.root, this.roots, this.nocase, this.childrenCache(), opts); - } -} -/** - * 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. - */ -export 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; - /** - * A collection of all roots encountered, referenced by rootPath - */ - roots; - /** - * The Path entry corresponding to this PathScurry's current working directory. - */ - cwd; - #resolveCache; - #children; - /** - * Perform path comparisons case-insensitively. - * - * Defaults true on Darwin and Windows systems, false elsewhere. - */ - nocase; - #fs; - /** - * This class should not be instantiated directly. - * - * Use PathScurryWin32, PathScurryDarwin, PathScurryPosix, or PathScurry - * - * @internal - */ - constructor(cwd = process.cwd(), pathImpl, sep, { nocase, childrenCacheSize = 16 * 1024, fs = defaultFS, } = {}) { - this.#fs = fsFromOption(fs); - if (cwd instanceof URL || cwd.startsWith('file://')) { - cwd = fileURLToPath(cwd); - } - // 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.#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 */ - if (nocase === undefined) { - throw new TypeError('must provide nocase setting to PathScurryBase ctor'); - } - /* 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) { - prev = prev.child(part, { - relative: new Array(len--).fill('..').join(joinSep), - fullpath: (abs += (sawFirst ? '' : joinSep) + part), - }); - sawFirst = true; - } - this.cwd = prev; - } - /** - * 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 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; - } - /** - * 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; - } - /** - * 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(); - } - /** - * 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; - } - /** - * 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(); - } - 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); - } - } - 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); - } - } - /** - * 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); - } - return entry.lstat(); - } - /** - * synchronous {@link PathScurryBase.lstat} - */ - lstatSync(entry = this.cwd) { - if (typeof entry === 'string') { - entry = this.cwd.resolve(entry); - } - 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; - } - 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); - } - else if (!(entry instanceof PathBase)) { - withFileTypes = entry.withFileTypes; - entry = this.cwd; - } - 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(); - } - 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(); - } - 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; - } - 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); - }); - }); - } - 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); - } - } - } - 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(); - } - 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](); - } - /** - * Iterating over a PathScurry performs a synchronous walk. - * - * Alias for {@link PathScurryBase.iterateSync} - */ - [Symbol.iterator]() { - return this.iterateSync(); - } - *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); - } - } - } - } - 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({ 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); - } - else if (!(entry instanceof PathBase)) { - opts = entry; - entry = this.cwd; - } - const { withFileTypes = true, follow = false, filter, walkFilter, } = opts; - const results = new 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; - } -} -/** - * Windows implementation of {@link PathScurryBase} - * - * Defaults to case insensitve, uses `'\\'` to generate path strings. Uses - * {@link PathWin32} for Path objects. - */ -export class PathScurryWin32 extends PathScurryBase { - /** - * separator for generating path strings - */ - sep = '\\'; - constructor(cwd = process.cwd(), opts = {}) { - const { nocase = true } = opts; - super(cwd, 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 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)); - } -} -/** - * {@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. - */ -export class PathScurryPosix extends PathScurryBase { - /** - * separator for generating path strings - */ - sep = '/'; - constructor(cwd = process.cwd(), opts = {}) { - const { nocase = false } = opts; - super(cwd, 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 }); - } - /** - * Return true if the provided path string is an absolute path - */ - isAbsolute(p) { - return p.startsWith('/'); - } -} -/** - * {@link PathScurryBase} implementation for Darwin (macOS) systems. - * - * Defaults to case-insensitive matching, uses `'/'` for generating path - * strings. - * - * Uses {@link PathPosix} for Path objects. - */ -export class PathScurryDarwin extends PathScurryPosix { - constructor(cwd = process.cwd(), opts = {}) { - const { nocase = true } = opts; - super(cwd, { ...opts, nocase }); - } -} -/** - * Default {@link PathBase} implementation for the current platform. - * - * {@link PathWin32} on Windows systems, {@link PathPosix} on all others. - */ -export const 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. - */ -export const PathScurry = process.platform === 'win32' - ? PathScurryWin32 - : process.platform === 'darwin' - ? PathScurryDarwin - : PathScurryPosix; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/path-scurry/dist/mjs/index.js.map b/node_modules/path-scurry/dist/mjs/index.js.map deleted file mode 100644 index 8f0ba56b05..0000000000 --- a/node_modules/path-scurry/dist/mjs/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"m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AAuB,EAAE;QAEzB,MAAM,EAAE,MAAM,GAAG,IAAI,EAAE,GAAG,IAAI,CAAA;QAC9B,KAAK,CAAC,GAAG,EAAE,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,CAAC,CAAA;IACjC,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAA;AAGxE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,UAAU,GAIrB,OAAO,CAAC,QAAQ,KAAK,OAAO;IAC1B,CAAC,CAAC,eAAe;IACjB,CAAC,CAAC,OAAO,CAAC,QAAQ,KAAK,QAAQ;QAC/B,CAAC,CAAC,gBAAgB;QAClB,CAAC,CAAC,eAAe,CAAA"} \ No newline at end of file diff --git a/node_modules/path-scurry/dist/mjs/package.json b/node_modules/path-scurry/dist/mjs/package.json deleted file mode 100644 index 3dbc1ca591..0000000000 --- a/node_modules/path-scurry/dist/mjs/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "module" -} diff --git a/node_modules/path-scurry/node_modules/lru-cache/LICENSE b/node_modules/path-scurry/node_modules/lru-cache/LICENSE deleted file mode 100644 index f785757cd6..0000000000 --- a/node_modules/path-scurry/node_modules/lru-cache/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) 2010-2023 Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/path-scurry/node_modules/lru-cache/README.md b/node_modules/path-scurry/node_modules/lru-cache/README.md deleted file mode 100644 index f128330755..0000000000 --- a/node_modules/path-scurry/node_modules/lru-cache/README.md +++ /dev/null @@ -1,1117 +0,0 @@ -# lru-cache - -A cache object that deletes the least-recently-used items. - -Specify a max number of the most recently used items that you -want to keep, and this cache will keep that many of the most -recently accessed items. - -This is not primarily a TTL cache, and does not make strong TTL -guarantees. There is no preemptive pruning of expired items by -default, but you _may_ set a TTL on the cache or on a single -`set`. If you do so, it will treat expired items as missing, and -delete them when fetched. If you are more interested in TTL -caching than LRU caching, check out -[@isaacs/ttlcache](http://npm.im/@isaacs/ttlcache). - -As of version 7, this is one of the most performant LRU -implementations available in JavaScript, and supports a wide -diversity of use cases. However, note that using some of the -features will necessarily impact performance, by causing the -cache to have to do more work. See the "Performance" section -below. - -## Installation - -```bash -npm install lru-cache --save -``` - -## Usage - -```js -// hybrid module, either works -import LRUCache from 'lru-cache' -// or: -const LRUCache = require('lru-cache') - -// At least one of 'max', 'ttl', or 'maxSize' is required, to prevent -// unsafe unbounded storage. -// -// In most cases, it's best to specify a max for performance, so all -// the required memory allocation is done up-front. -// -// All the other options are optional, see the sections below for -// documentation on what each one does. Most of them can be -// overridden for specific items in get()/set() -const options = { - max: 500, - - // for use with tracking overall storage size - maxSize: 5000, - sizeCalculation: (value, key) => { - return 1 - }, - - // for use when you need to clean up something when objects - // are evicted from the cache - dispose: (value, key) => { - freeFromMemoryOrWhatever(value) - }, - - // how long to live in ms - ttl: 1000 * 60 * 5, - - // return stale items before removing from cache? - allowStale: false, - - updateAgeOnGet: false, - updateAgeOnHas: false, - - // async method to use for cache.fetch(), for - // stale-while-revalidate type of behavior - fetchMethod: async (key, staleValue, { options, signal }) => {}, -} - -const cache = new LRUCache(options) - -cache.set('key', 'value') -cache.get('key') // "value" - -// non-string keys ARE fully supported -// but note that it must be THE SAME object, not -// just a JSON-equivalent object. -var someObject = { a: 1 } -cache.set(someObject, 'a value') -// Object keys are not toString()-ed -cache.set('[object Object]', 'a different value') -assert.equal(cache.get(someObject), 'a value') -// A similar object with same keys/values won't work, -// because it's a different object identity -assert.equal(cache.get({ a: 1 }), undefined) - -cache.clear() // empty the cache -``` - -If you put more stuff in it, then items will fall out. - -## Options - -### `max` - -The maximum number of items that remain in the cache (assuming no -TTL pruning or explicit deletions). Note that fewer items may be -stored if size calculation is used, and `maxSize` is exceeded. -This must be a positive finite intger. - -At least one of `max`, `maxSize`, or `TTL` is required. This -must be a positive integer if set. - -**It is strongly recommended to set a `max` to prevent unbounded -growth of the cache.** See "Storage Bounds Safety" below. - -### `maxSize` - -Set to a positive integer to track the sizes of items added to -the cache, and automatically evict items in order to stay below -this size. Note that this may result in fewer than `max` items -being stored. - -Attempting to add an item to the cache whose calculated size is -greater that this amount will be a no-op. The item will not be -cached, and no other items will be evicted. - -Optional, must be a positive integer if provided. - -Sets `maxEntrySize` to the same value, unless a different value -is provided for `maxEntrySize`. - -At least one of `max`, `maxSize`, or `TTL` is required. This -must be a positive integer if set. - -Even if size tracking is enabled, **it is strongly recommended to -set a `max` to prevent unbounded growth of the cache.** See -"Storage Bounds Safety" below. - -### `maxEntrySize` - -Set to a positive integer to track the sizes of items added to -the cache, and prevent caching any item over a given size. -Attempting to add an item whose calculated size is greater than -this amount will be a no-op. The item will not be cached, and no -other items will be evicted. - -Optional, must be a positive integer if provided. Defaults to -the value of `maxSize` if provided. - -### `sizeCalculation` - -Function used to calculate the size of stored items. If you're -storing strings or buffers, then you probably want to do -something like `n => n.length`. The item is passed as the first -argument, and the key is passed as the second argument. - -This may be overridden by passing an options object to -`cache.set()`. - -Requires `maxSize` to be set. - -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. - -Deprecated alias: `length` - -### `fetchMethod` - -Function that is used to make background asynchronous fetches. -Called with `fetchMethod(key, staleValue, { signal, options, -context })`. May return a Promise. - -If `fetchMethod` is not provided, then `cache.fetch(key)` is -equivalent to `Promise.resolve(cache.get(key))`. - -The `signal` object is an `AbortSignal` if that's available in -the global object, otherwise it's a pretty close polyfill. - -If at any time, `signal.aborted` is set to `true`, or if the -`signal.onabort` method is called, or if it emits an `'abort'` -event which you can listen to with `addEventListener`, then that -means that the fetch should be abandoned. This may be passed -along to async functions aware of AbortController/AbortSignal -behavior. - -The `fetchMethod` should **only** return `undefined` or a Promise -resolving to `undefined` if the AbortController signaled an -`abort` event. In all other cases, it should return or resolve -to a value suitable for adding to the cache. - -The `options` object is a union of the options that may be -provided to `set()` and `get()`. If they are modified, then that -will result in modifying the settings to `cache.set()` when the -value is resolved, and in the case of `noDeleteOnFetchRejection` -and `allowStaleOnFetchRejection`, the handling of `fetchMethod` -failures. - -For example, a DNS cache may update the TTL based on the value -returned from a remote DNS server by changing `options.ttl` in -the `fetchMethod`. - -### `fetchContext` - -Arbitrary data that can be passed to the `fetchMethod` as the -`context` option. - -Note that this will only be relevant when the `cache.fetch()` -call needs to call `fetchMethod()`. Thus, any data which will -meaningfully vary the fetch response needs to be present in the -key. This is primarily intended for including `x-request-id` -headers and the like for debugging purposes, which do not affect -the `fetchMethod()` response. - -### `noDeleteOnFetchRejection` - -If a `fetchMethod` throws an error or returns a rejected promise, -then by default, any existing stale value will be removed from -the cache. - -If `noDeleteOnFetchRejection` is set to `true`, then this -behavior is suppressed, and the stale value remains in the cache -in the case of a rejected `fetchMethod`. - -This is important in cases where a `fetchMethod` is _only_ called -as a background update while the stale value is returned, when -`allowStale` is used. - -This is implicitly in effect when `allowStaleOnFetchRejection` is -set. - -This may be set in calls to `fetch()`, or defaulted on the -constructor, or overridden by modifying the options object in the -`fetchMethod`. - -### `allowStaleOnFetchRejection` - -Set to true to return a stale value from the cache when a -`fetchMethod` throws an error or returns a rejected Promise. - -If a `fetchMethod` fails, and there is no stale value available, -the `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` -errors are suppressed. - -Implies `noDeleteOnFetchRejection`. - -This may be set in calls to `fetch()`, or defaulted on the -constructor, or overridden by modifying the options object in the -`fetchMethod`. - -### `allowStaleOnFetchAbort` - -Set to true to return a stale value from the cache when the -`AbortSignal` passed to the `fetchMethod` dispatches an `'abort'` -event, whether user-triggered, or due to internal cache behavior. - -Unless `ignoreFetchAbort` is also set, the underlying -`fetchMethod` will still be considered canceled, and its return -value will be ignored and not cached. - -### `ignoreFetchAbort` - -Set to true to ignore the `abort` event emitted by the -`AbortSignal` object passed to `fetchMethod`, and still cache the -resulting resolution value, as long as it is not `undefined`. - -When used on its own, this means aborted `fetch()` calls are not -immediately resolved or rejected when they are aborted, and -instead take the full time to await. - -When used with `allowStaleOnFetchAbort`, aborted `fetch()` calls -will resolve immediately to their stale cached value or -`undefined`, and will continue to process and eventually update -the cache when they resolve, as long as the resulting value is -not `undefined`, thus supporting a "return stale on timeout while -refreshing" mechanism by passing `AbortSignal.timeout(n)` as the -signal. - -For example: - -```js -const c = new LRUCache({ - ttl: 100, - ignoreFetchAbort: true, - allowStaleOnFetchAbort: true, - fetchMethod: async (key, oldValue, { signal }) => { - // note: do NOT pass the signal to fetch()! - // let's say this fetch can take a long time. - const res = await fetch(`https://slow-backend-server/${key}`) - return await res.json() - }, -}) - -// this will return the stale value after 100ms, while still -// updating in the background for next time. -const val = await c.fetch('key', { signal: AbortSignal.timeout(100) }) -``` - -**Note**: regardless of this setting, an `abort` event _is still -emitted on the `AbortSignal` object_, so may result in invalid -results when passed to other underlying APIs that use -AbortSignals. - -This may be overridden on the `fetch()` call or in the -`fetchMethod` itself. - -### `dispose` - -Function that is called on items when they are dropped from the -cache, as `this.dispose(value, key, reason)`. - -This can be handy if you want to close file descriptors or do -other cleanup tasks when items are no longer stored in the cache. - -**NOTE**: It is called _before_ the item has been fully removed -from the cache, so if you want to put it right back in, you need -to wait until the next tick. If you try to add it back in during -the `dispose()` function call, it will break things in subtle and -weird ways. - -Unlike several other options, this may _not_ be overridden by -passing an option to `set()`, for performance reasons. If -disposal functions may vary between cache entries, then the -entire list must be scanned on every cache swap, even if no -disposal function is in use. - -The `reason` will be one of the following strings, corresponding -to the reason for the item's deletion: - -- `evict` Item was evicted to make space for a new addition -- `set` Item was overwritten by a new value -- `delete` Item was removed by explicit `cache.delete(key)` or by - calling `cache.clear()`, which deletes everything. - -The `dispose()` method is _not_ called for canceled calls to -`fetchMethod()`. If you wish to handle evictions, overwrites, -and deletes of in-flight asynchronous fetches, you must use the -`AbortSignal` provided. - -Optional, must be a function. - -### `disposeAfter` - -The same as `dispose`, but called _after_ the entry is completely -removed and the cache is once again in a clean state. - -It is safe to add an item right back into the cache at this -point. However, note that it is _very_ easy to inadvertently -create infinite recursion in this way. - -The `disposeAfter()` method is _not_ called for canceled calls to -`fetchMethod()`. If you wish to handle evictions, overwrites, -and deletes of in-flight asynchronous fetches, you must use the -`AbortSignal` provided. - -### `noDisposeOnSet` - -Set to `true` to suppress calling the `dispose()` function if the -entry key is still accessible within the cache. - -This may be overridden by passing an options object to -`cache.set()`. - -Boolean, default `false`. Only relevant if `dispose` or -`disposeAfter` options are set. - -### `ttl` - -Max time to live for items before they are considered stale. -Note that stale items are NOT preemptively removed by default, -and MAY live in the cache, contributing to its LRU max, long -after they have expired. - -Also, as this cache is optimized for LRU/MRU operations, some of -the staleness/TTL checks will reduce performance. - -This is not primarily a TTL cache, and does not make strong TTL -guarantees. There is no pre-emptive pruning of expired items, -but you _may_ set a TTL on the cache, and it will treat expired -items as missing when they are fetched, and delete them. - -Optional, but must be a positive integer in ms if specified. - -This may be overridden by passing an options object to -`cache.set()`. - -At least one of `max`, `maxSize`, or `TTL` is required. This -must be a positive integer if set. - -Even if ttl tracking is enabled, **it is strongly recommended to -set a `max` to prevent unbounded growth of the cache.** See -"Storage Bounds Safety" below. - -If ttl tracking is enabled, and `max` and `maxSize` are not set, -and `ttlAutopurge` is not set, then a warning will be emitted -cautioning about the potential for unbounded memory consumption. - -Deprecated alias: `maxAge` - -### `noUpdateTTL` - -Boolean flag to tell the cache to not update the TTL when setting -a new value for an existing key (ie, when updating a value rather -than inserting a new value). Note that the TTL value is _always_ -set (if provided) when adding a new entry into the cache. - -This may be passed as an option to `cache.set()`. - -Boolean, default false. - -### `ttlResolution` - -Minimum amount of time in ms in which to check for staleness. -Defaults to `1`, which means that the current time is checked at -most once per millisecond. - -Set to `0` to check the current time every time staleness is -tested. - -Note that setting this to a higher value _will_ improve -performance somewhat while using ttl tracking, albeit at the -expense of keeping stale items around a bit longer than intended. - -### `ttlAutopurge` - -Preemptively remove stale items from the cache. - -Note that this may _significantly_ degrade performance, -especially if the cache is storing a large number of items. It -is almost always best to just leave the stale items in the cache, -and let them fall out as new items are added. - -Note that this means that `allowStale` is a bit pointless, as -stale items will be deleted almost as soon as they expire. - -Use with caution! - -Boolean, default `false` - -### `allowStale` - -By default, if you set `ttl`, it'll only delete stale items from -the cache when you `get(key)`. That is, it's not preemptively -pruning items. - -If you set `allowStale:true`, it'll return the stale value as -well as deleting it. If you don't set this, then it'll return -`undefined` when you try to get a stale entry. - -Note that when a stale entry is fetched, _even if it is returned -due to `allowStale` being set_, it is removed from the cache -immediately. You can immediately put it back in the cache if you -wish, thus resetting the TTL. - -This may be overridden by passing an options object to -`cache.get()`. The `cache.has()` method will always return -`false` for stale items. - -Boolean, default false, only relevant if `ttl` is set. - -Deprecated alias: `stale` - -### `noDeleteOnStaleGet` - -When using time-expiring entries with `ttl`, by default stale -items will be removed from the cache when the key is accessed -with `cache.get()`. - -Setting `noDeleteOnStaleGet` to `true` will cause stale items to -remain in the cache, until they are explicitly deleted with -`cache.delete(key)`, or retrieved with `noDeleteOnStaleGet` set -to `false`. - -This may be overridden by passing an options object to -`cache.get()`. - -Boolean, default false, only relevant if `ttl` is set. - -### `updateAgeOnGet` - -When using time-expiring entries with `ttl`, setting this to -`true` will make each item's age reset to 0 whenever it is -retrieved from cache with `get()`, causing it to not expire. (It -can still fall out of cache based on recency of use, of course.) - -This may be overridden by passing an options object to -`cache.get()`. - -Boolean, default false, only relevant if `ttl` is set. - -### `updateAgeOnHas` - -When using time-expiring entries with `ttl`, setting this to -`true` will make each item's age reset to 0 whenever its presence -in the cache is checked with `has()`, causing it to not expire. -(It can still fall out of cache based on recency of use, of -course.) - -This may be overridden by passing an options object to -`cache.has()`. - -Boolean, default false, only relevant if `ttl` is set. - -## API - -### `new LRUCache(options)` - -Create a new LRUCache. All options are documented above, and are -on the cache as public members. - -### `cache.max`, `cache.maxSize`, `cache.allowStale`, - -`cache.noDisposeOnSet`, `cache.sizeCalculation`, `cache.dispose`, -`cache.maxSize`, `cache.ttl`, `cache.updateAgeOnGet`, -`cache.updateAgeOnHas` - -All option names are exposed as public members on the cache -object. - -These are intended for read access only. Changing them during -program operation can cause undefined behavior. - -### `cache.size` - -The total number of items held in the cache at the current -moment. - -### `cache.calculatedSize` - -The total size of items in cache when using size tracking. - -### `set(key, value, [{ size, sizeCalculation, ttl, noDisposeOnSet, start, status }])` - -Add a value to the cache. - -Optional options object may contain `ttl` and `sizeCalculation` -as described above, which default to the settings on the cache -object. - -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. - -Returns the cache object. - -For the usage of the `status` option, see **Status Tracking** -below. - -### `get(key, { updateAgeOnGet, allowStale, status } = {}) => value` - -Return a value from the cache. - -Will update the recency of the cache entry found. - -If the key is not found, `get()` will return `undefined`. This -can be confusing when setting values specifically to `undefined`, -as in `cache.set(key, undefined)`. Use `cache.has()` to -determine whether a key is present in the cache at all. - -For the usage of the `status` option, see **Status Tracking** -below. - -### `async fetch(key, options = {}) => Promise` - -The following options are supported: - -- `updateAgeOnGet` -- `allowStale` -- `size` -- `sizeCalculation` -- `ttl` -- `noDisposeOnSet` -- `forceRefresh` -- `status` - See **Status Tracking** below. -- `signal` - AbortSignal can be used to cancel the `fetch()`. - Note that the `signal` option provided to the `fetchMethod` is - a different object, because it must also respond to internal - cache state changes, but aborting this signal will abort the - one passed to `fetchMethod` as well. -- `fetchContext` - sets the `context` option passed to the - underlying `fetchMethod`. - -If the value is in the cache and not stale, then the returned -Promise resolves to the value. - -If not in the cache, or beyond its TTL staleness, then -`fetchMethod(key, staleValue, { options, signal, context })` is -called, and the value returned will be added to the cache once -resolved. - -If called with `allowStale`, and an asynchronous fetch is -currently in progress to reload a stale value, then the former -stale value will be returned. - -If called with `forceRefresh`, then the cached item will be -re-fetched, even if it is not stale. However, if `allowStale` is -set, then the old value will still be returned. This is useful -in cases where you want to force a reload of a cached value. If -a background fetch is already in progress, then `forceRefresh` -has no effect. - -Multiple fetches for the same `key` will only call `fetchMethod` -a single time, and all will be resolved when the value is -resolved, even if different options are used. - -If `fetchMethod` is not specified, then this is effectively an -alias for `Promise.resolve(cache.get(key))`. - -When the fetch method resolves to a value, if the fetch has not -been aborted due to deletion, eviction, or being overwritten, -then it is added to the cache using the options provided. - -If the key is evicted or deleted before the `fetchMethod` -resolves, then the AbortSignal passed to the `fetchMethod` will -receive an `abort` event, and the promise returned by `fetch()` -will reject with the reason for the abort. - -If a `signal` is passed to the `fetch()` call, then aborting the -signal will abort the fetch and cause the `fetch()` promise to -reject with the reason provided. - -### `peek(key, { allowStale } = {}) => value` - -Like `get()` but doesn't update recency or delete stale items. - -Returns `undefined` if the item is stale, unless `allowStale` is -set either on the cache or in the options object. - -### `has(key, { updateAgeOnHas, status } = {}) => Boolean` - -Check if a key is in the cache, without updating the recency of -use. Age is updated if `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. - -For the usage of the `status` option, see **Status Tracking** -below. - -### `delete(key)` - -Deletes a key out of the cache. - -Returns `true` if the key was deleted, `false` otherwise. - -### `clear()` - -Clear the cache entirely, throwing away all values. - -Deprecated alias: `reset()` - -### `keys()` - -Return a generator yielding the keys in the cache, in order from -most recently used to least recently used. - -### `rkeys()` - -Return a generator yielding the keys in the cache, in order from -least recently used to most recently used. - -### `values()` - -Return a generator yielding the values in the cache, in order -from most recently used to least recently used. - -### `rvalues()` - -Return a generator yielding the values in the cache, in order -from least recently used to most recently used. - -### `entries()` - -Return a generator yielding `[key, value]` pairs, in order from -most recently used to least recently used. - -### `rentries()` - -Return a generator yielding `[key, value]` pairs, in order from -least recently used to most recently used. - -### `find(fn, [getOptions])` - -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)`. - -The optional `getOptions` are applied to the resulting `get()` of -the item found. - -### `dump()` - -Return an array of `[key, entry]` objects which can be passed to -`cache.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 -`allowStale` is false. - -Note: this returns an actual array, not a generator, so it can be -more easily passed around. - -### `load(entries)` - -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 `start` fields are assumed to be calculated relative to a -portable `Date.now()` timestamp, even if `performance.now()` is -available. - -### `purgeStale()` - -Delete any stale entries. Returns `true` if anything was -removed, `false` otherwise. - -Deprecated alias: `prune` - -### `getRemainingTTL(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. - -### `forEach(fn, [thisp])` - -Call the `fn` function with each set of `fn(value, key, cache)` -in the LRU cache, from most recent to least recently used. - -Does not affect recency of use. - -If `thisp` is provided, function will be called in the -`this`-context of the provided object. - -### `rforEach(fn, [thisp])` - -Same as `cache.forEach(fn, thisp)`, but in order from least -recently used to most recently used. - -### `pop()` - -Evict the least recently used item, returning its value. - -Returns `undefined` if cache is empty. - -### Internal Methods and Properties - -In order to optimize performance as much as possible, "private" -members and methods are exposed on the object as normal -properties, rather than being accessed via Symbols, private -members, or closure variables. - -**Do not use or rely on these.** They will change or be removed -without notice. They will cause undefined behavior if used -inappropriately. There is no need or reason to ever call them -directly. - -This documentation is here so that it is especially clear that -this not "undocumented" because someone forgot; it _is_ -documented, and the documentation is telling you not to do it. - -**Do not report bugs that stem from using these properties.** -They will be ignored. - -- `initializeTTLTracking()` Set up the cache for tracking TTLs -- `updateItemAge(index)` Called when an item age is updated, by - internal ID -- `setItemTTL(index)` Called when an item ttl is updated, by - internal ID -- `isStale(index)` Called to check an item's staleness, by - internal ID -- `initializeSizeTracking()` Set up the cache for tracking item - size. Called automatically when a size is specified. -- `removeItemSize(index)` Updates the internal size calculation - when an item is removed or modified, by internal ID -- `addItemSize(index)` Updates the internal size calculation when - an item is added or modified, by internal ID -- `indexes()` An iterator over the non-stale internal IDs, from - most recently to least recently used. -- `rindexes()` An iterator over the non-stale internal IDs, from - least recently to most recently used. -- `newIndex()` Create a new internal ID, either reusing a deleted - ID, evicting the least recently used ID, or walking to the end - of the allotted space. -- `evict()` Evict the least recently used internal ID, returning - its ID. Does not do any bounds checking. -- `connect(p, n)` Connect the `p` and `n` internal IDs in the - linked list. -- `moveToTail(index)` Move the specified internal ID to the most - recently used position. -- `keyMap` Map of keys to internal IDs -- `keyList` List of keys by internal ID -- `valList` List of values by internal ID -- `sizes` List of calculated sizes by internal ID -- `ttls` List of TTL values by internal ID -- `starts` List of start time values by internal ID -- `next` Array of "next" pointers by internal ID -- `prev` Array of "previous" pointers by internal ID -- `head` Internal ID of least recently used item -- `tail` Internal ID of most recently used item -- `free` Stack of deleted internal IDs - -## Status Tracking - -Occasionally, it may be useful to track the internal behavior of -the cache, particularly for logging, debugging, or for behavior -within the `fetchMethod`. To do this, you can pass a `status` -object to the `get()`, `set()`, `has()`, and `fetch()` methods. - -The `status` option should be a plain JavaScript object. - -The following fields will be set appropriately: - -```ts -interface Status { - /** - * The status of a set() operation. - * - * - add: the item was not found in the cache, and was added - * - update: the item was in the cache, with the same value provided - * - replace: the item was in the cache, and replaced - * - miss: the item was not added to the cache for some reason - */ - set?: 'add' | 'update' | 'replace' | 'miss' - - /** - * the ttl stored for the item, or undefined if ttls are not used. - */ - ttl?: LRUMilliseconds - - /** - * the start time for the item, or undefined if ttls are not used. - */ - start?: LRUMilliseconds - - /** - * The timestamp used for TTL calculation - */ - now?: LRUMilliseconds - - /** - * the remaining ttl for the item, or undefined if ttls are not used. - */ - remainingTTL?: LRUMilliseconds - - /** - * The calculated size for the item, if sizes are used. - */ - size?: LRUSize - - /** - * A flag indicating that the item was not stored, due to exceeding the - * {@link maxEntrySize} - */ - maxEntrySizeExceeded?: true - - /** - * The old value, specified in the case of `set:'update'` or - * `set:'replace'` - */ - oldValue?: V - - /** - * The results of a {@link has} operation - * - * - hit: the item was found in the cache - * - stale: the item was found in the cache, but is stale - * - miss: the item was not found in the cache - */ - has?: 'hit' | 'stale' | 'miss' - - /** - * The status of a {@link fetch} operation. - * Note that this can change as the underlying fetch() moves through - * various states. - * - * - inflight: there is another fetch() for this key which is in process - * - get: there is no fetchMethod, so {@link get} was called. - * - miss: the item is not in cache, and will be fetched. - * - hit: the item is in the cache, and was resolved immediately. - * - stale: the item is in the cache, but stale. - * - refresh: the item is in the cache, and not stale, but - * {@link forceRefresh} was specified. - */ - fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh' - - /** - * The {@link fetchMethod} was called - */ - fetchDispatched?: true - - /** - * The cached value was updated after a successful call to fetchMethod - */ - fetchUpdated?: true - - /** - * The reason for a fetch() rejection. Either the error raised by the - * {@link fetchMethod}, or the reason for an AbortSignal. - */ - fetchError?: Error - - /** - * The fetch received an abort signal - */ - fetchAborted?: true - - /** - * The abort signal received was ignored, and the fetch was allowed to - * continue. - */ - fetchAbortIgnored?: true - - /** - * The fetchMethod promise resolved successfully - */ - fetchResolved?: true - - /** - * The results of the fetchMethod promise were stored in the cache - */ - fetchUpdated?: true - - /** - * The fetchMethod promise was rejected - */ - fetchRejected?: true - - /** - * The status of a {@link get} operation. - * - * - fetching: The item is currently being fetched. If a previous value is - * present and allowed, that will be returned. - * - stale: The item is in the cache, and is stale. - * - hit: the item is in the cache - * - miss: the item is not in the cache - */ - get?: 'stale' | 'hit' | 'miss' - - /** - * A fetch or get operation returned a stale value. - */ - returnedStale?: true -} -``` - -## Storage Bounds Safety - -This implementation aims to be as flexible as possible, within -the limits of safe memory consumption and optimal performance. - -At initial object creation, storage is allocated for `max` items. -If `max` is set to zero, then some performance is lost, and item -count is unbounded. Either `maxSize` or `ttl` _must_ be set if -`max` is not specified. - -If `maxSize` is set, then this creates a safe limit on the -maximum storage consumed, but without the performance benefits of -pre-allocation. When `maxSize` is set, every item _must_ provide -a size, either via the `sizeCalculation` method provided to the -constructor, or via a `size` or `sizeCalculation` option provided -to `cache.set()`. The size of every item _must_ be a positive -integer. - -If neither `max` nor `maxSize` are set, then `ttl` tracking must -be enabled. Note that, even when tracking item `ttl`, items are -_not_ preemptively deleted when they become stale, unless -`ttlAutopurge` is enabled. Instead, they are only purged the -next time the key is requested. Thus, if `ttlAutopurge`, `max`, -and `maxSize` are all not set, then the cache will potentially -grow unbounded. - -In this case, a warning is printed to standard error. Future -versions may require the use of `ttlAutopurge` if `max` and -`maxSize` are not specified. - -If you truly wish to use a cache that is bound _only_ by TTL -expiration, consider using a `Map` object, and calling -`setTimeout` to delete entries when they expire. It will perform -much better than an LRU cache. - -Here is an implementation you may use, under the same -[license](./LICENSE) as this package: - -```js -// a storage-unbounded ttl cache that is not an lru-cache -const cache = { - data: new Map(), - timers: new Map(), - set: (k, v, ttl) => { - if (cache.timers.has(k)) { - clearTimeout(cache.timers.get(k)) - } - cache.timers.set( - k, - setTimeout(() => cache.delete(k), ttl) - ) - cache.data.set(k, v) - }, - get: k => cache.data.get(k), - has: k => cache.data.has(k), - delete: k => { - if (cache.timers.has(k)) { - clearTimeout(cache.timers.get(k)) - } - cache.timers.delete(k) - return cache.data.delete(k) - }, - clear: () => { - cache.data.clear() - for (const v of cache.timers.values()) { - clearTimeout(v) - } - cache.timers.clear() - }, -} -``` - -If that isn't to your liking, check out -[@isaacs/ttlcache](http://npm.im/@isaacs/ttlcache). - -## Performance - -As of January 2022, version 7 of this library is one of the most -performant LRU cache implementations in JavaScript. - -Benchmarks can be extremely difficult to get right. In -particular, the performance of set/get/delete operations on -objects will vary _wildly_ depending on the type of key used. V8 -is highly optimized for objects with keys that are short strings, -especially integer numeric strings. Thus any benchmark which -tests _solely_ using numbers as keys will tend to find that an -object-based approach performs the best. - -Note that coercing _anything_ to strings to use as object keys is -unsafe, unless you can be 100% certain that no other type of -value will be used. For example: - -```js -const myCache = {} -const set = (k, v) => (myCache[k] = v) -const get = k => myCache[k] - -set({}, 'please hang onto this for me') -set('[object Object]', 'oopsie') -``` - -Also beware of "Just So" stories regarding performance. Garbage -collection of large (especially: deep) object graphs can be -incredibly costly, with several "tipping points" where it -increases exponentially. As a result, putting that off until -later can make it much worse, and less predictable. If a library -performs well, but only in a scenario where the object graph is -kept shallow, then that won't help you if you are using large -objects as keys. - -In general, when attempting to use a library to improve -performance (such as a cache like this one), it's best to choose -an option that will perform well in the sorts of scenarios where -you'll actually use it. - -This library is optimized for repeated gets and minimizing -eviction time, since that is the expected need of a LRU. Set -operations are somewhat slower on average than a few other -options, in part because of that optimization. It is assumed -that you'll be caching some costly operation, ideally as rarely -as possible, so optimizing set over get would be unwise. - -If performance matters to you: - -1. If it's at all possible to use small integer values as keys, - and you can guarantee that no other types of values will be - used as keys, then do that, and use a cache such as - [lru-fast](https://npmjs.com/package/lru-fast), or - [mnemonist's - LRUCache](https://yomguithereal.github.io/mnemonist/lru-cache) - which uses an Object as its data store. -2. Failing that, if at all possible, use short non-numeric - strings (ie, less than 256 characters) as your keys, and use - [mnemonist's - LRUCache](https://yomguithereal.github.io/mnemonist/lru-cache). -3. If the types of your keys will be long strings, strings that - look like floats, `null`, objects, or some mix of types, or if - you aren't sure, then this library will work well for you. -4. Do not use a `dispose` function, size tracking, or especially - ttl behavior, unless absolutely needed. These features are - convenient, and necessary in some use cases, and every attempt - has been made to make the performance impact minimal, but it - isn't nothing. - -## Breaking Changes in Version 7 - -This library changed to a different algorithm and internal data -structure in version 7, yielding significantly better -performance, albeit with some subtle changes as a result. - -If you were relying on the internals of LRUCache in version 6 or -before, it probably will not work in version 7 and above. - -For more info, see the [change log](CHANGELOG.md). diff --git a/node_modules/path-scurry/node_modules/lru-cache/index.d.ts b/node_modules/path-scurry/node_modules/lru-cache/index.d.ts deleted file mode 100644 index b58395e04a..0000000000 --- a/node_modules/path-scurry/node_modules/lru-cache/index.d.ts +++ /dev/null @@ -1,869 +0,0 @@ -// Project: https://github.com/isaacs/node-lru-cache -// Based initially on @types/lru-cache -// https://github.com/DefinitelyTyped/DefinitelyTyped -// used under the terms of the MIT License, shown below. -// -// DefinitelyTyped license: -// ------ -// MIT License -// -// Copyright (c) Microsoft Corporation. -// -// 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 -// ------ -// -// Changes by Isaac Z. Schlueter released under the terms found in the -// LICENSE file within this project. - -/** - * Integer greater than 0, representing some number of milliseconds, or the - * time at which a TTL started counting from. - */ -declare type LRUMilliseconds = number - -/** - * An integer greater than 0, reflecting the calculated size of items - */ -declare type LRUSize = number - -/** - * An integer greater than 0, reflecting a number of items - */ -declare type LRUCount = number - -declare class LRUCache implements Iterable<[K, V]> { - constructor(options: LRUCache.Options) - - /** - * Number of items in the cache. - * Alias for {@link size} - * - * @deprecated since 7.0 use {@link size} instead - */ - public readonly length: LRUCount - - public readonly max: LRUCount - public readonly maxSize: LRUSize - public readonly maxEntrySize: LRUSize - public readonly sizeCalculation: - | LRUCache.SizeCalculator - | undefined - public readonly dispose: LRUCache.Disposer - /** - * @since 7.4.0 - */ - public readonly disposeAfter: LRUCache.Disposer | null - public readonly noDisposeOnSet: boolean - public readonly ttl: LRUMilliseconds - public readonly ttlResolution: LRUMilliseconds - public readonly ttlAutopurge: boolean - public readonly allowStale: boolean - public readonly updateAgeOnGet: boolean - /** - * @since 7.11.0 - */ - public readonly noDeleteOnStaleGet: boolean - /** - * @since 7.6.0 - */ - public readonly fetchMethod: LRUCache.Fetcher | null - - /** - * The total number of items held in the cache at the current moment. - */ - public readonly size: LRUCount - - /** - * The total size of items in cache when using size tracking. - */ - public readonly calculatedSize: LRUSize - - /** - * Add a value to the cache. - */ - public set( - key: K, - value: V, - options?: LRUCache.SetOptions - ): this - - /** - * Return a value from the cache. Will update the recency of the cache entry - * found. - * - * If the key is not found, {@link get} will return `undefined`. This can be - * confusing when setting values specifically to `undefined`, as in - * `cache.set(key, undefined)`. Use {@link has} to determine whether a key is - * present in the cache at all. - */ - public get(key: K, options?: LRUCache.GetOptions): V | undefined - - /** - * Like {@link get} but doesn't update recency or delete stale items. - * Returns `undefined` if the item is stale, unless {@link allowStale} is set - * either on the cache or in the options object. - */ - public peek(key: K, options?: LRUCache.PeekOptions): V | undefined - - /** - * Check if a key is in the cache, without updating the recency of use. - * Will return false if the item is stale, even though it is technically - * in the cache. - * - * Will not update item age unless {@link updateAgeOnHas} is set in the - * options or constructor. - */ - public has(key: K, options?: LRUCache.HasOptions): boolean - - /** - * Deletes a key out of the cache. - * Returns true if the key was deleted, false otherwise. - */ - public delete(key: K): boolean - - /** - * Clear the cache entirely, throwing away all values. - */ - public clear(): void - - /** - * Delete any stale entries. Returns true if anything was removed, false - * otherwise. - */ - public purgeStale(): boolean - - /** - * 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). - */ - public find( - callbackFn: ( - value: V, - key: K, - cache: this - ) => boolean | undefined | void, - options?: LRUCache.GetOptions - ): V | undefined - - /** - * 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. - */ - public forEach( - callbackFn: (this: T, value: V, key: K, cache: this) => void, - thisArg?: T - ): void - - /** - * The same as {@link forEach} but items are iterated over in reverse - * order. (ie, less recently used items are iterated over first.) - */ - public rforEach( - callbackFn: (this: T, value: V, key: K, cache: this) => void, - thisArg?: T - ): void - - /** - * Return a generator yielding the keys in the cache, - * in order from most recently used to least recently used. - */ - public keys(): Generator - - /** - * Inverse order version of {@link keys} - * - * Return a generator yielding the keys in the cache, - * in order from least recently used to most recently used. - */ - public rkeys(): Generator - - /** - * Return a generator yielding the values in the cache, - * in order from most recently used to least recently used. - */ - public values(): Generator - - /** - * Inverse order version of {@link values} - * - * Return a generator yielding the values in the cache, - * in order from least recently used to most recently used. - */ - public rvalues(): Generator - - /** - * Return a generator yielding `[key, value]` pairs, - * in order from most recently used to least recently used. - */ - public entries(): Generator<[K, V], void, void> - - /** - * Inverse order version of {@link entries} - * - * Return a generator yielding `[key, value]` pairs, - * in order from least recently used to most recently used. - */ - public rentries(): Generator<[K, V], void, void> - - /** - * Iterating over the cache itself yields the same results as - * {@link entries} - */ - public [Symbol.iterator](): Generator<[K, V], void, void> - - /** - * Return an array of [key, entry] objects which can be passed to - * cache.load() - */ - public dump(): Array<[K, LRUCache.Entry]> - - /** - * 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. - */ - public load( - cacheEntries: ReadonlyArray<[K, LRUCache.Entry]> - ): void - - /** - * Evict the least recently used item, returning its value or `undefined` - * if cache is empty. - */ - public pop(): V | undefined - - /** - * Deletes a key out of the cache. - * - * @deprecated since 7.0 use delete() instead - */ - public del(key: K): boolean - - /** - * Clear the cache entirely, throwing away all values. - * - * @deprecated since 7.0 use clear() instead - */ - public reset(): void - - /** - * Manually iterates over the entire cache proactively pruning old entries. - * - * @deprecated since 7.0 use purgeStale() instead - */ - public prune(): boolean - - /** - * Make an asynchronous cached fetch using the {@link fetchMethod} function. - * - * If multiple fetches for the same key are issued, then they will all be - * coalesced into a single call to fetchMethod. - * - * Note that this means that handling options such as - * {@link allowStaleOnFetchAbort}, {@link signal}, and - * {@link allowStaleOnFetchRejection} will be determined by the FIRST fetch() - * call for a given key. - * - * This is a known (fixable) shortcoming which will be addresed on when - * someone complains about it, as the fix would involve added complexity and - * may not be worth the costs for this edge case. - * - * since: 7.6.0 - */ - public fetch( - key: K, - options?: LRUCache.FetchOptions - ): Promise - - /** - * since: 7.6.0 - */ - public getRemainingTTL(key: K): LRUMilliseconds -} - -declare namespace LRUCache { - type DisposeReason = 'evict' | 'set' | 'delete' - - type SizeCalculator = (value: V, key: K) => LRUSize - type Disposer = ( - value: V, - key: K, - reason: DisposeReason - ) => void - type Fetcher = ( - key: K, - staleValue: V | undefined, - options: FetcherOptions - ) => Promise | V | void | undefined - - interface DeprecatedOptions { - /** - * alias for ttl - * - * @deprecated since 7.0 use options.ttl instead - */ - maxAge?: LRUMilliseconds - - /** - * alias for {@link sizeCalculation} - * - * @deprecated since 7.0 use {@link sizeCalculation} instead - */ - length?: SizeCalculator - - /** - * alias for allowStale - * - * @deprecated since 7.0 use options.allowStale instead - */ - stale?: boolean - } - - interface LimitedByCount { - /** - * The number of most recently used items to keep. - * Note that we may store fewer items than this if maxSize is hit. - */ - max: LRUCount - } - - type MaybeMaxEntrySizeLimit = - | { - /** - * The maximum allowed size for any single item in the cache. - * - * If a larger item is passed to {@link set} or returned by a - * {@link fetchMethod}, then it will not be stored in the cache. - */ - maxEntrySize: LRUSize - sizeCalculation?: SizeCalculator - } - | {} - - interface LimitedBySize { - /** - * If you wish to track item size, you must provide a maxSize - * note that we still will only keep up to max *actual items*, - * if max is set, so size tracking may cause fewer than max items - * to be stored. At the extreme, a single item of maxSize size - * will cause everything else in the cache to be dropped when it - * is added. Use with caution! - * - * Note also that size tracking can negatively impact performance, - * though for most cases, only minimally. - */ - maxSize: LRUSize - - /** - * Function to calculate size of items. Useful if storing strings or - * buffers or other items where memory size depends on the object itself. - * - * Items larger than {@link maxEntrySize} will not be stored in the cache. - * - * Note that when {@link maxSize} or {@link maxEntrySize} are set, every - * item added MUST have a size specified, either via a `sizeCalculation` in - * the constructor, or `sizeCalculation` or {@link size} options to - * {@link set}. - */ - sizeCalculation?: SizeCalculator - } - - interface LimitedByTTL { - /** - * Max time in milliseconds for items to live in cache before they are - * considered stale. Note that stale items are NOT preemptively removed - * by default, and MAY live in the cache, contributing to its LRU max, - * long after they have expired. - * - * Also, as this cache is optimized for LRU/MRU operations, some of - * the staleness/TTL checks will reduce performance, as they will incur - * overhead by deleting items. - * - * Must be an integer number of ms, defaults to 0, which means "no TTL" - */ - ttl: LRUMilliseconds - - /** - * Boolean flag to tell the cache to not update the TTL when - * setting a new value for an existing key (ie, when updating a value - * rather than inserting a new value). Note that the TTL value is - * _always_ set (if provided) when adding a new entry into the cache. - * - * @default false - * @since 7.4.0 - */ - noUpdateTTL?: boolean - - /** - * Minimum amount of time in ms in which to check for staleness. - * Defaults to 1, which means that the current time is checked - * at most once per millisecond. - * - * Set to 0 to check the current time every time staleness is tested. - * (This reduces performance, and is theoretically unnecessary.) - * - * Setting this to a higher value will improve performance somewhat - * while using ttl tracking, albeit at the expense of keeping stale - * items around a bit longer than their TTLs would indicate. - * - * @default 1 - * @since 7.1.0 - */ - ttlResolution?: LRUMilliseconds - - /** - * Preemptively remove stale items from the cache. - * Note that this may significantly degrade performance, - * especially if the cache is storing a large number of items. - * It is almost always best to just leave the stale items in - * the cache, and let them fall out as new items are added. - * - * Note that this means that {@link allowStale} is a bit pointless, - * as stale items will be deleted almost as soon as they expire. - * - * Use with caution! - * - * @default false - * @since 7.1.0 - */ - ttlAutopurge?: boolean - - /** - * Return stale items from {@link get} before disposing of them. - * Return stale values from {@link fetch} while performing a call - * to the {@link fetchMethod} in the background. - * - * @default false - */ - allowStale?: boolean - - /** - * Update the age of items on {@link get}, renewing their TTL - * - * @default false - */ - updateAgeOnGet?: boolean - - /** - * Do not delete stale items when they are retrieved with {@link get}. - * Note that the {@link get} return value will still be `undefined` unless - * allowStale is true. - * - * @default false - * @since 7.11.0 - */ - noDeleteOnStaleGet?: boolean - - /** - * Update the age of items on {@link has}, renewing their TTL - * - * @default false - */ - updateAgeOnHas?: boolean - } - - type SafetyBounds = - | LimitedByCount - | LimitedBySize - | LimitedByTTL - - // options shared by all three of the limiting scenarios - interface SharedOptions { - /** - * Function that is called on items when they are dropped from the cache. - * This can be handy if you want to close file descriptors or do other - * cleanup tasks when items are no longer accessible. Called with `key, - * value`. It's called before actually removing the item from the - * internal cache, so it is *NOT* safe to re-add them. - * Use {@link disposeAfter} if you wish to dispose items after they have - * been full removed, when it is safe to add them back to the cache. - */ - dispose?: Disposer - - /** - * The same as dispose, but called *after* the entry is completely - * removed and the cache is once again in a clean state. It is safe to - * add an item right back into the cache at this point. - * However, note that it is *very* easy to inadvertently create infinite - * recursion this way. - * - * @since 7.3.0 - */ - disposeAfter?: Disposer - - /** - * Set to true to suppress calling the dispose() function if the entry - * key is still accessible within the cache. - * This may be overridden by passing an options object to {@link set}. - * - * @default false - */ - noDisposeOnSet?: boolean - - /** - * Function that is used to make background asynchronous fetches. Called - * with `fetchMethod(key, staleValue, { signal, options, context })`. - * - * If `fetchMethod` is not provided, then {@link fetch} is - * equivalent to `Promise.resolve(cache.get(key))`. - * - * The `fetchMethod` should ONLY return `undefined` in cases where the - * abort controller has sent an abort signal. - * - * @since 7.6.0 - */ - fetchMethod?: LRUCache.Fetcher - - /** - * Set to true to suppress the deletion of stale data when a - * {@link fetchMethod} throws an error or returns a rejected promise - * - * This may be overridden in the {@link fetchMethod}. - * - * @default false - * @since 7.10.0 - */ - noDeleteOnFetchRejection?: boolean - - /** - * Set to true to allow returning stale data when a {@link fetchMethod} - * throws an error or returns a rejected promise. Note that this - * differs from using {@link allowStale} in that stale data will - * ONLY be returned in the case that the fetch fails, not any other - * times. - * - * This may be overridden in the {@link fetchMethod}. - * - * @default false - * @since 7.16.0 - */ - allowStaleOnFetchRejection?: boolean - - /** - * - * Set to true to ignore the `abort` event emitted by the `AbortSignal` - * object passed to {@link fetchMethod}, and still cache the - * resulting resolution value, as long as it is not `undefined`. - * - * When used on its own, this means aborted {@link fetch} calls are not - * immediately resolved or rejected when they are aborted, and instead take - * the full time to await. - * - * When used with {@link allowStaleOnFetchAbort}, aborted {@link fetch} - * calls will resolve immediately to their stale cached value or - * `undefined`, and will continue to process and eventually update the - * cache when they resolve, as long as the resulting value is not - * `undefined`, thus supporting a "return stale on timeout while - * refreshing" mechanism by passing `AbortSignal.timeout(n)` as the signal. - * - * **Note**: regardless of this setting, an `abort` event _is still emitted - * on the `AbortSignal` object_, so may result in invalid results when - * passed to other underlying APIs that use AbortSignals. - * - * This may be overridden in the {@link fetchMethod} or the call to - * {@link fetch}. - * - * @default false - * @since 7.17.0 - */ - ignoreFetchAbort?: boolean - - /** - * Set to true to return a stale value from the cache when the - * `AbortSignal` passed to the {@link fetchMethod} dispatches an `'abort'` - * event, whether user-triggered, or due to internal cache behavior. - * - * Unless {@link ignoreFetchAbort} is also set, the underlying - * {@link fetchMethod} will still be considered canceled, and its return - * value will be ignored and not cached. - * - * This may be overridden in the {@link fetchMethod} or the call to - * {@link fetch}. - * - * @default false - * @since 7.17.0 - */ - allowStaleOnFetchAbort?: boolean - - /** - * Set to any value in the constructor or {@link fetch} options to - * pass arbitrary data to the {@link fetchMethod} in the {@link context} - * options field. - * - * @since 7.12.0 - */ - fetchContext?: any - } - - type Options = SharedOptions & - DeprecatedOptions & - SafetyBounds & - MaybeMaxEntrySizeLimit - - /** - * options which override the options set in the LRUCache constructor - * when making calling {@link set}. - */ - interface SetOptions { - /** - * A value for the size of the entry, prevents calls to - * {@link sizeCalculation}. - * - * Items larger than {@link maxEntrySize} will not be stored in the cache. - * - * Note that when {@link maxSize} or {@link maxEntrySize} are set, every - * item added MUST have a size specified, either via a `sizeCalculation` in - * the constructor, or {@link sizeCalculation} or `size` options to - * {@link set}. - */ - size?: LRUSize - /** - * Overrides the {@link sizeCalculation} method set in the constructor. - * - * Items larger than {@link maxEntrySize} will not be stored in the cache. - * - * Note that when {@link maxSize} or {@link maxEntrySize} are set, every - * item added MUST have a size specified, either via a `sizeCalculation` in - * the constructor, or `sizeCalculation` or {@link size} options to - * {@link set}. - */ - sizeCalculation?: SizeCalculator - ttl?: LRUMilliseconds - start?: LRUMilliseconds - noDisposeOnSet?: boolean - noUpdateTTL?: boolean - status?: Status - } - - /** - * options which override the options set in the LRUCAche constructor - * when calling {@link has}. - */ - interface HasOptions { - updateAgeOnHas?: boolean - status: Status - } - - /** - * options which override the options set in the LRUCache constructor - * when calling {@link get}. - */ - interface GetOptions { - allowStale?: boolean - updateAgeOnGet?: boolean - noDeleteOnStaleGet?: boolean - status?: Status - } - - /** - * options which override the options set in the LRUCache constructor - * when calling {@link peek}. - */ - interface PeekOptions { - allowStale?: boolean - } - - /** - * Options object passed to the {@link fetchMethod} - * - * May be mutated by the {@link fetchMethod} to affect the behavior of the - * resulting {@link set} operation on resolution, or in the case of - * {@link noDeleteOnFetchRejection}, {@link ignoreFetchAbort}, and - * {@link allowStaleOnFetchRejection}, the handling of failure. - */ - interface FetcherFetchOptions { - allowStale?: boolean - updateAgeOnGet?: boolean - noDeleteOnStaleGet?: boolean - size?: LRUSize - sizeCalculation?: SizeCalculator - ttl?: LRUMilliseconds - noDisposeOnSet?: boolean - noUpdateTTL?: boolean - noDeleteOnFetchRejection?: boolean - allowStaleOnFetchRejection?: boolean - ignoreFetchAbort?: boolean - allowStaleOnFetchAbort?: boolean - status?: Status - } - - /** - * Status object that may be passed to {@link fetch}, {@link get}, - * {@link set}, and {@link has}. - */ - interface Status { - /** - * The status of a set() operation. - * - * - add: the item was not found in the cache, and was added - * - update: the item was in the cache, with the same value provided - * - replace: the item was in the cache, and replaced - * - miss: the item was not added to the cache for some reason - */ - set?: 'add' | 'update' | 'replace' | 'miss' - - /** - * the ttl stored for the item, or undefined if ttls are not used. - */ - ttl?: LRUMilliseconds - - /** - * the start time for the item, or undefined if ttls are not used. - */ - start?: LRUMilliseconds - - /** - * The timestamp used for TTL calculation - */ - now?: LRUMilliseconds - - /** - * the remaining ttl for the item, or undefined if ttls are not used. - */ - remainingTTL?: LRUMilliseconds - - /** - * The calculated size for the item, if sizes are used. - */ - size?: LRUSize - - /** - * A flag indicating that the item was not stored, due to exceeding the - * {@link maxEntrySize} - */ - maxEntrySizeExceeded?: true - - /** - * The old value, specified in the case of `set:'update'` or - * `set:'replace'` - */ - oldValue?: V - - /** - * The results of a {@link has} operation - * - * - hit: the item was found in the cache - * - stale: the item was found in the cache, but is stale - * - miss: the item was not found in the cache - */ - has?: 'hit' | 'stale' | 'miss' - - /** - * The status of a {@link fetch} operation. - * Note that this can change as the underlying fetch() moves through - * various states. - * - * - inflight: there is another fetch() for this key which is in process - * - get: there is no fetchMethod, so {@link get} was called. - * - miss: the item is not in cache, and will be fetched. - * - hit: the item is in the cache, and was resolved immediately. - * - stale: the item is in the cache, but stale. - * - refresh: the item is in the cache, and not stale, but - * {@link forceRefresh} was specified. - */ - fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh' - - /** - * The {@link fetchMethod} was called - */ - fetchDispatched?: true - - /** - * The cached value was updated after a successful call to fetchMethod - */ - fetchUpdated?: true - - /** - * The reason for a fetch() rejection. Either the error raised by the - * {@link fetchMethod}, or the reason for an AbortSignal. - */ - fetchError?: Error - - /** - * The fetch received an abort signal - */ - fetchAborted?: true - - /** - * The abort signal received was ignored, and the fetch was allowed to - * continue. - */ - fetchAbortIgnored?: true - - /** - * The fetchMethod promise resolved successfully - */ - fetchResolved?: true - - /** - * The fetchMethod promise was rejected - */ - fetchRejected?: true - - /** - * The status of a {@link get} operation. - * - * - fetching: The item is currently being fetched. If a previous value is - * present and allowed, that will be returned. - * - stale: The item is in the cache, and is stale. - * - hit: the item is in the cache - * - miss: the item is not in the cache - */ - get?: 'stale' | 'hit' | 'miss' - - /** - * A fetch or get operation returned a stale value. - */ - returnedStale?: true - } - - /** - * options which override the options set in the LRUCache constructor - * when calling {@link fetch}. - * - * This is the union of GetOptions and SetOptions, plus - * {@link noDeleteOnFetchRejection}, {@link allowStaleOnFetchRejection}, - * {@link forceRefresh}, and {@link fetchContext} - */ - interface FetchOptions extends FetcherFetchOptions { - forceRefresh?: boolean - fetchContext?: any - signal?: AbortSignal - status?: Status - } - - interface FetcherOptions { - signal: AbortSignal - options: FetcherFetchOptions - /** - * Object provided in the {@link fetchContext} option - */ - context: any - } - - interface Entry { - value: V - ttl?: LRUMilliseconds - size?: LRUSize - start?: LRUMilliseconds - } -} - -export = LRUCache diff --git a/node_modules/path-scurry/node_modules/lru-cache/index.js b/node_modules/path-scurry/node_modules/lru-cache/index.js deleted file mode 100644 index 48e99fe5e5..0000000000 --- a/node_modules/path-scurry/node_modules/lru-cache/index.js +++ /dev/null @@ -1,1227 +0,0 @@ -const perf = - typeof performance === 'object' && - performance && - typeof performance.now === 'function' - ? performance - : Date - -const hasAbortController = typeof AbortController === 'function' - -// minimal backwards-compatibility polyfill -// this doesn't have nearly all the checks and whatnot that -// actual AbortController/Signal has, but it's enough for -// our purposes, and if used properly, behaves the same. -const AC = hasAbortController - ? AbortController - : class AbortController { - constructor() { - this.signal = new AS() - } - abort(reason = new Error('This operation was aborted')) { - this.signal.reason = this.signal.reason || reason - this.signal.aborted = true - this.signal.dispatchEvent({ - type: 'abort', - target: this.signal, - }) - } - } - -const hasAbortSignal = typeof AbortSignal === 'function' -// Some polyfills put this on the AC class, not global -const hasACAbortSignal = typeof AC.AbortSignal === 'function' -const AS = hasAbortSignal - ? AbortSignal - : hasACAbortSignal - ? AC.AbortController - : class AbortSignal { - constructor() { - this.reason = undefined - this.aborted = false - this._listeners = [] - } - dispatchEvent(e) { - if (e.type === 'abort') { - this.aborted = true - this.onabort(e) - this._listeners.forEach(f => f(e), this) - } - } - onabort() {} - addEventListener(ev, fn) { - if (ev === 'abort') { - this._listeners.push(fn) - } - } - removeEventListener(ev, fn) { - if (ev === 'abort') { - this._listeners = this._listeners.filter(f => f !== fn) - } - } - } - -const warned = new Set() -const deprecatedOption = (opt, instead) => { - const code = `LRU_CACHE_OPTION_${opt}` - if (shouldWarn(code)) { - warn(code, `${opt} option`, `options.${instead}`, LRUCache) - } -} -const deprecatedMethod = (method, instead) => { - const code = `LRU_CACHE_METHOD_${method}` - if (shouldWarn(code)) { - const { prototype } = LRUCache - const { get } = Object.getOwnPropertyDescriptor(prototype, method) - warn(code, `${method} method`, `cache.${instead}()`, get) - } -} -const deprecatedProperty = (field, instead) => { - const code = `LRU_CACHE_PROPERTY_${field}` - if (shouldWarn(code)) { - const { prototype } = LRUCache - const { get } = Object.getOwnPropertyDescriptor(prototype, field) - warn(code, `${field} property`, `cache.${instead}`, get) - } -} - -const emitWarning = (...a) => { - typeof process === 'object' && - process && - typeof process.emitWarning === 'function' - ? process.emitWarning(...a) - : console.error(...a) -} - -const shouldWarn = code => !warned.has(code) - -const warn = (code, what, instead, fn) => { - warned.add(code) - const msg = `The ${what} is deprecated. Please use ${instead} instead.` - emitWarning(msg, 'DeprecationWarning', code, fn) -} - -const isPosInt = n => n && n === Math.floor(n) && n > 0 && isFinite(n) - -/* istanbul ignore next - This is a little bit ridiculous, tbh. - * The maximum array length is 2^32-1 or thereabouts on most JS impls. - * And well before that point, you're caching the entire world, I mean, - * that's ~32GB of just integers for the next/prev links, plus whatever - * else to hold that many keys and values. Just filling the memory with - * zeroes at init time is brutal when you get that big. - * But why not be complete? - * Maybe in the future, these limits will have expanded. */ -const getUintArray = max => - !isPosInt(max) - ? null - : max <= Math.pow(2, 8) - ? Uint8Array - : max <= Math.pow(2, 16) - ? Uint16Array - : max <= Math.pow(2, 32) - ? Uint32Array - : max <= Number.MAX_SAFE_INTEGER - ? ZeroArray - : null - -class ZeroArray extends Array { - constructor(size) { - super(size) - this.fill(0) - } -} - -class Stack { - constructor(max) { - if (max === 0) { - return [] - } - const UintArray = getUintArray(max) - this.heap = new UintArray(max) - this.length = 0 - } - push(n) { - this.heap[this.length++] = n - } - pop() { - return this.heap[--this.length] - } -} - -class LRUCache { - constructor(options = {}) { - const { - max = 0, - ttl, - ttlResolution = 1, - ttlAutopurge, - updateAgeOnGet, - updateAgeOnHas, - allowStale, - dispose, - disposeAfter, - noDisposeOnSet, - noUpdateTTL, - maxSize = 0, - maxEntrySize = 0, - sizeCalculation, - fetchMethod, - fetchContext, - noDeleteOnFetchRejection, - noDeleteOnStaleGet, - allowStaleOnFetchRejection, - allowStaleOnFetchAbort, - ignoreFetchAbort, - } = options - - // deprecated options, don't trigger a warning for getting them if - // the thing being passed in is another LRUCache we're copying. - const { length, maxAge, stale } = - options instanceof LRUCache ? {} : options - - if (max !== 0 && !isPosInt(max)) { - throw new TypeError('max option must be a nonnegative integer') - } - - const UintArray = max ? getUintArray(max) : Array - if (!UintArray) { - throw new Error('invalid max value: ' + max) - } - - this.max = max - this.maxSize = maxSize - this.maxEntrySize = maxEntrySize || this.maxSize - this.sizeCalculation = sizeCalculation || length - if (this.sizeCalculation) { - if (!this.maxSize && !this.maxEntrySize) { - throw new TypeError( - 'cannot set sizeCalculation without setting maxSize or maxEntrySize' - ) - } - if (typeof this.sizeCalculation !== 'function') { - throw new TypeError('sizeCalculation set to non-function') - } - } - - this.fetchMethod = fetchMethod || null - if (this.fetchMethod && typeof this.fetchMethod !== 'function') { - throw new TypeError( - 'fetchMethod must be a function if specified' - ) - } - - this.fetchContext = fetchContext - if (!this.fetchMethod && fetchContext !== undefined) { - throw new TypeError( - 'cannot set fetchContext without fetchMethod' - ) - } - - this.keyMap = new Map() - this.keyList = new Array(max).fill(null) - this.valList = new Array(max).fill(null) - this.next = new UintArray(max) - this.prev = new UintArray(max) - this.head = 0 - this.tail = 0 - this.free = new Stack(max) - this.initialFill = 1 - this.size = 0 - - if (typeof dispose === 'function') { - this.dispose = dispose - } - if (typeof disposeAfter === 'function') { - this.disposeAfter = disposeAfter - this.disposed = [] - } else { - this.disposeAfter = null - this.disposed = null - } - this.noDisposeOnSet = !!noDisposeOnSet - this.noUpdateTTL = !!noUpdateTTL - this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection - this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection - this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort - this.ignoreFetchAbort = !!ignoreFetchAbort - - // NB: maxEntrySize is set to maxSize if it's set - if (this.maxEntrySize !== 0) { - if (this.maxSize !== 0) { - if (!isPosInt(this.maxSize)) { - throw new TypeError( - 'maxSize must be a positive integer if specified' - ) - } - } - if (!isPosInt(this.maxEntrySize)) { - throw new TypeError( - 'maxEntrySize must be a positive integer if specified' - ) - } - this.initializeSizeTracking() - } - - this.allowStale = !!allowStale || !!stale - this.noDeleteOnStaleGet = !!noDeleteOnStaleGet - this.updateAgeOnGet = !!updateAgeOnGet - this.updateAgeOnHas = !!updateAgeOnHas - this.ttlResolution = - isPosInt(ttlResolution) || ttlResolution === 0 - ? ttlResolution - : 1 - this.ttlAutopurge = !!ttlAutopurge - this.ttl = ttl || maxAge || 0 - if (this.ttl) { - if (!isPosInt(this.ttl)) { - throw new TypeError( - 'ttl must be a positive integer if specified' - ) - } - this.initializeTTLTracking() - } - - // do not allow completely unbounded caches - if (this.max === 0 && this.ttl === 0 && this.maxSize === 0) { - throw new TypeError( - 'At least one of max, maxSize, or ttl is required' - ) - } - if (!this.ttlAutopurge && !this.max && !this.maxSize) { - const code = 'LRU_CACHE_UNBOUNDED' - if (shouldWarn(code)) { - warned.add(code) - const msg = - 'TTL caching without ttlAutopurge, max, or maxSize can ' + - 'result in unbounded memory consumption.' - emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache) - } - } - - if (stale) { - deprecatedOption('stale', 'allowStale') - } - if (maxAge) { - deprecatedOption('maxAge', 'ttl') - } - if (length) { - deprecatedOption('length', 'sizeCalculation') - } - } - - getRemainingTTL(key) { - return this.has(key, { updateAgeOnHas: false }) ? Infinity : 0 - } - - initializeTTLTracking() { - this.ttls = new ZeroArray(this.max) - this.starts = new ZeroArray(this.max) - - this.setItemTTL = (index, ttl, start = perf.now()) => { - this.starts[index] = ttl !== 0 ? start : 0 - this.ttls[index] = ttl - if (ttl !== 0 && this.ttlAutopurge) { - const t = setTimeout(() => { - if (this.isStale(index)) { - this.delete(this.keyList[index]) - } - }, ttl + 1) - /* istanbul ignore else - unref() not supported on all platforms */ - if (t.unref) { - t.unref() - } - } - } - - this.updateItemAge = index => { - this.starts[index] = this.ttls[index] !== 0 ? perf.now() : 0 - } - - this.statusTTL = (status, index) => { - if (status) { - status.ttl = this.ttls[index] - status.start = this.starts[index] - status.now = cachedNow || getNow() - status.remainingTTL = status.now + status.ttl - status.start - } - } - - // debounce calls to perf.now() to 1s so we're not hitting - // that costly call repeatedly. - let cachedNow = 0 - const getNow = () => { - const n = perf.now() - if (this.ttlResolution > 0) { - cachedNow = n - const t = setTimeout( - () => (cachedNow = 0), - this.ttlResolution - ) - /* istanbul ignore else - not available on all platforms */ - if (t.unref) { - t.unref() - } - } - return n - } - - this.getRemainingTTL = key => { - const index = this.keyMap.get(key) - if (index === undefined) { - return 0 - } - return this.ttls[index] === 0 || this.starts[index] === 0 - ? Infinity - : this.starts[index] + - this.ttls[index] - - (cachedNow || getNow()) - } - - this.isStale = index => { - return ( - this.ttls[index] !== 0 && - this.starts[index] !== 0 && - (cachedNow || getNow()) - this.starts[index] > - this.ttls[index] - ) - } - } - updateItemAge(_index) {} - statusTTL(_status, _index) {} - setItemTTL(_index, _ttl, _start) {} - isStale(_index) { - return false - } - - initializeSizeTracking() { - this.calculatedSize = 0 - this.sizes = new ZeroArray(this.max) - this.removeItemSize = index => { - this.calculatedSize -= this.sizes[index] - this.sizes[index] = 0 - } - this.requireSize = (k, v, size, sizeCalculation) => { - // provisionally accept background fetches. - // actual value size will be checked when they return. - if (this.isBackgroundFetch(v)) { - return 0 - } - if (!isPosInt(size)) { - if (sizeCalculation) { - if (typeof sizeCalculation !== 'function') { - throw new TypeError('sizeCalculation must be a function') - } - size = sizeCalculation(v, k) - if (!isPosInt(size)) { - throw new TypeError( - 'sizeCalculation return invalid (expect positive integer)' - ) - } - } else { - throw new TypeError( - 'invalid size value (must be positive integer). ' + - 'When maxSize or maxEntrySize is used, sizeCalculation or size ' + - 'must be set.' - ) - } - } - return size - } - this.addItemSize = (index, size, status) => { - this.sizes[index] = size - if (this.maxSize) { - const maxSize = this.maxSize - this.sizes[index] - while (this.calculatedSize > maxSize) { - this.evict(true) - } - } - this.calculatedSize += this.sizes[index] - if (status) { - status.entrySize = size - status.totalCalculatedSize = this.calculatedSize - } - } - } - removeItemSize(_index) {} - addItemSize(_index, _size) {} - requireSize(_k, _v, size, sizeCalculation) { - if (size || sizeCalculation) { - throw new TypeError( - 'cannot set size without setting maxSize or maxEntrySize on cache' - ) - } - } - - *indexes({ allowStale = this.allowStale } = {}) { - if (this.size) { - for (let i = this.tail; true; ) { - if (!this.isValidIndex(i)) { - break - } - if (allowStale || !this.isStale(i)) { - yield i - } - if (i === this.head) { - break - } else { - i = this.prev[i] - } - } - } - } - - *rindexes({ allowStale = this.allowStale } = {}) { - if (this.size) { - for (let i = this.head; true; ) { - if (!this.isValidIndex(i)) { - break - } - if (allowStale || !this.isStale(i)) { - yield i - } - if (i === this.tail) { - break - } else { - i = this.next[i] - } - } - } - } - - isValidIndex(index) { - return ( - index !== undefined && - this.keyMap.get(this.keyList[index]) === index - ) - } - - *entries() { - for (const i of this.indexes()) { - if ( - this.valList[i] !== undefined && - this.keyList[i] !== undefined && - !this.isBackgroundFetch(this.valList[i]) - ) { - yield [this.keyList[i], this.valList[i]] - } - } - } - *rentries() { - for (const i of this.rindexes()) { - if ( - this.valList[i] !== undefined && - this.keyList[i] !== undefined && - !this.isBackgroundFetch(this.valList[i]) - ) { - yield [this.keyList[i], this.valList[i]] - } - } - } - - *keys() { - for (const i of this.indexes()) { - if ( - this.keyList[i] !== undefined && - !this.isBackgroundFetch(this.valList[i]) - ) { - yield this.keyList[i] - } - } - } - *rkeys() { - for (const i of this.rindexes()) { - if ( - this.keyList[i] !== undefined && - !this.isBackgroundFetch(this.valList[i]) - ) { - yield this.keyList[i] - } - } - } - - *values() { - for (const i of this.indexes()) { - if ( - this.valList[i] !== undefined && - !this.isBackgroundFetch(this.valList[i]) - ) { - yield this.valList[i] - } - } - } - *rvalues() { - for (const i of this.rindexes()) { - if ( - this.valList[i] !== undefined && - !this.isBackgroundFetch(this.valList[i]) - ) { - yield this.valList[i] - } - } - } - - [Symbol.iterator]() { - return this.entries() - } - - find(fn, getOptions) { - for (const i of this.indexes()) { - const v = this.valList[i] - const value = this.isBackgroundFetch(v) - ? v.__staleWhileFetching - : v - if (value === undefined) continue - if (fn(value, this.keyList[i], this)) { - return this.get(this.keyList[i], getOptions) - } - } - } - - forEach(fn, thisp = this) { - for (const i of this.indexes()) { - const v = this.valList[i] - const value = this.isBackgroundFetch(v) - ? v.__staleWhileFetching - : v - if (value === undefined) continue - fn.call(thisp, value, this.keyList[i], this) - } - } - - rforEach(fn, thisp = this) { - for (const i of this.rindexes()) { - const v = this.valList[i] - const value = this.isBackgroundFetch(v) - ? v.__staleWhileFetching - : v - if (value === undefined) continue - fn.call(thisp, value, this.keyList[i], this) - } - } - - get prune() { - deprecatedMethod('prune', 'purgeStale') - return this.purgeStale - } - - purgeStale() { - let deleted = false - for (const i of this.rindexes({ allowStale: true })) { - if (this.isStale(i)) { - this.delete(this.keyList[i]) - deleted = true - } - } - return deleted - } - - dump() { - const arr = [] - for (const i of this.indexes({ allowStale: true })) { - const key = this.keyList[i] - const v = this.valList[i] - const value = this.isBackgroundFetch(v) - ? v.__staleWhileFetching - : v - if (value === undefined) continue - const entry = { value } - if (this.ttls) { - entry.ttl = this.ttls[i] - // always dump the start relative to a portable timestamp - // it's ok for this to be a bit slow, it's a rare operation. - const age = perf.now() - this.starts[i] - entry.start = Math.floor(Date.now() - age) - } - if (this.sizes) { - entry.size = this.sizes[i] - } - arr.unshift([key, entry]) - } - return arr - } - - load(arr) { - this.clear() - for (const [key, entry] of arr) { - if (entry.start) { - // entry.start is a portable timestamp, but we may be using - // node's performance.now(), so calculate the offset. - // it's ok for this to be a bit slow, it's a rare operation. - const age = Date.now() - entry.start - entry.start = perf.now() - age - } - this.set(key, entry.value, entry) - } - } - - dispose(_v, _k, _reason) {} - - set( - k, - v, - { - ttl = this.ttl, - start, - noDisposeOnSet = this.noDisposeOnSet, - size = 0, - sizeCalculation = this.sizeCalculation, - noUpdateTTL = this.noUpdateTTL, - status, - } = {} - ) { - size = this.requireSize(k, v, size, sizeCalculation) - // if the item doesn't fit, don't do anything - // NB: maxEntrySize set to maxSize by default - if (this.maxEntrySize && size > this.maxEntrySize) { - if (status) { - status.set = 'miss' - status.maxEntrySizeExceeded = true - } - // have to delete, in case a background fetch is there already. - // in non-async cases, this is a no-op - this.delete(k) - return this - } - let index = this.size === 0 ? undefined : this.keyMap.get(k) - if (index === undefined) { - // addition - index = this.newIndex() - this.keyList[index] = k - this.valList[index] = v - this.keyMap.set(k, index) - this.next[this.tail] = index - this.prev[index] = this.tail - this.tail = index - this.size++ - this.addItemSize(index, size, status) - if (status) { - status.set = 'add' - } - noUpdateTTL = false - } else { - // update - this.moveToTail(index) - const oldVal = this.valList[index] - if (v !== oldVal) { - if (this.isBackgroundFetch(oldVal)) { - oldVal.__abortController.abort(new Error('replaced')) - } else { - if (!noDisposeOnSet) { - this.dispose(oldVal, k, 'set') - if (this.disposeAfter) { - this.disposed.push([oldVal, k, 'set']) - } - } - } - this.removeItemSize(index) - this.valList[index] = v - this.addItemSize(index, size, status) - if (status) { - status.set = 'replace' - const oldValue = - oldVal && this.isBackgroundFetch(oldVal) - ? oldVal.__staleWhileFetching - : oldVal - if (oldValue !== undefined) status.oldValue = oldValue - } - } else if (status) { - status.set = 'update' - } - } - if (ttl !== 0 && this.ttl === 0 && !this.ttls) { - this.initializeTTLTracking() - } - if (!noUpdateTTL) { - this.setItemTTL(index, ttl, start) - } - this.statusTTL(status, index) - if (this.disposeAfter) { - while (this.disposed.length) { - this.disposeAfter(...this.disposed.shift()) - } - } - return this - } - - newIndex() { - if (this.size === 0) { - return this.tail - } - if (this.size === this.max && this.max !== 0) { - return this.evict(false) - } - if (this.free.length !== 0) { - return this.free.pop() - } - // initial fill, just keep writing down the list - return this.initialFill++ - } - - pop() { - if (this.size) { - const val = this.valList[this.head] - this.evict(true) - return val - } - } - - evict(free) { - const head = this.head - const k = this.keyList[head] - const v = this.valList[head] - if (this.isBackgroundFetch(v)) { - v.__abortController.abort(new Error('evicted')) - } else { - this.dispose(v, k, 'evict') - if (this.disposeAfter) { - this.disposed.push([v, k, 'evict']) - } - } - this.removeItemSize(head) - // if we aren't about to use the index, then null these out - if (free) { - this.keyList[head] = null - this.valList[head] = null - this.free.push(head) - } - this.head = this.next[head] - this.keyMap.delete(k) - this.size-- - return head - } - - has(k, { updateAgeOnHas = this.updateAgeOnHas, status } = {}) { - const index = this.keyMap.get(k) - if (index !== undefined) { - if (!this.isStale(index)) { - if (updateAgeOnHas) { - this.updateItemAge(index) - } - if (status) status.has = 'hit' - this.statusTTL(status, index) - return true - } else if (status) { - status.has = 'stale' - this.statusTTL(status, index) - } - } else if (status) { - status.has = 'miss' - } - return false - } - - // like get(), but without any LRU updating or TTL expiration - peek(k, { allowStale = this.allowStale } = {}) { - const index = this.keyMap.get(k) - if (index !== undefined && (allowStale || !this.isStale(index))) { - const v = this.valList[index] - // either stale and allowed, or forcing a refresh of non-stale value - return this.isBackgroundFetch(v) ? v.__staleWhileFetching : v - } - } - - backgroundFetch(k, index, options, context) { - const v = index === undefined ? undefined : this.valList[index] - if (this.isBackgroundFetch(v)) { - return v - } - const ac = new AC() - if (options.signal) { - options.signal.addEventListener('abort', () => - ac.abort(options.signal.reason) - ) - } - const fetchOpts = { - signal: ac.signal, - options, - context, - } - const cb = (v, updateCache = false) => { - const { aborted } = ac.signal - const ignoreAbort = options.ignoreFetchAbort && v !== undefined - if (options.status) { - if (aborted && !updateCache) { - options.status.fetchAborted = true - options.status.fetchError = ac.signal.reason - if (ignoreAbort) options.status.fetchAbortIgnored = true - } else { - options.status.fetchResolved = true - } - } - if (aborted && !ignoreAbort && !updateCache) { - return fetchFail(ac.signal.reason) - } - // either we didn't abort, and are still here, or we did, and ignored - if (this.valList[index] === p) { - if (v === undefined) { - if (p.__staleWhileFetching) { - this.valList[index] = p.__staleWhileFetching - } else { - this.delete(k) - } - } else { - if (options.status) options.status.fetchUpdated = true - this.set(k, v, fetchOpts.options) - } - } - return v - } - const eb = er => { - if (options.status) { - options.status.fetchRejected = true - options.status.fetchError = er - } - return fetchFail(er) - } - const fetchFail = er => { - const { aborted } = ac.signal - const allowStaleAborted = - aborted && options.allowStaleOnFetchAbort - const allowStale = - allowStaleAborted || options.allowStaleOnFetchRejection - const noDelete = allowStale || options.noDeleteOnFetchRejection - if (this.valList[index] === p) { - // if we allow stale on fetch rejections, then we need to ensure that - // the stale value is not removed from the cache when the fetch fails. - const del = !noDelete || p.__staleWhileFetching === undefined - if (del) { - this.delete(k) - } else if (!allowStaleAborted) { - // still replace the *promise* with the stale value, - // since we are done with the promise at this point. - // leave it untouched if we're still waiting for an - // aborted background fetch that hasn't yet returned. - this.valList[index] = p.__staleWhileFetching - } - } - if (allowStale) { - if (options.status && p.__staleWhileFetching !== undefined) { - options.status.returnedStale = true - } - return p.__staleWhileFetching - } else if (p.__returned === p) { - throw er - } - } - const pcall = (res, rej) => { - this.fetchMethod(k, v, fetchOpts).then(v => res(v), rej) - // ignored, we go until we finish, regardless. - // defer check until we are actually aborting, - // so fetchMethod can override. - ac.signal.addEventListener('abort', () => { - if ( - !options.ignoreFetchAbort || - options.allowStaleOnFetchAbort - ) { - res() - // when it eventually resolves, update the cache. - if (options.allowStaleOnFetchAbort) { - res = v => cb(v, true) - } - } - }) - } - if (options.status) options.status.fetchDispatched = true - const p = new Promise(pcall).then(cb, eb) - p.__abortController = ac - p.__staleWhileFetching = v - p.__returned = null - if (index === undefined) { - // internal, don't expose status. - this.set(k, p, { ...fetchOpts.options, status: undefined }) - index = this.keyMap.get(k) - } else { - this.valList[index] = p - } - return p - } - - isBackgroundFetch(p) { - return ( - p && - typeof p === 'object' && - typeof p.then === 'function' && - Object.prototype.hasOwnProperty.call( - p, - '__staleWhileFetching' - ) && - Object.prototype.hasOwnProperty.call(p, '__returned') && - (p.__returned === p || p.__returned === null) - ) - } - - // this takes the union of get() and set() opts, because it does both - async fetch( - k, - { - // get options - allowStale = this.allowStale, - updateAgeOnGet = this.updateAgeOnGet, - noDeleteOnStaleGet = this.noDeleteOnStaleGet, - // set options - ttl = this.ttl, - noDisposeOnSet = this.noDisposeOnSet, - size = 0, - sizeCalculation = this.sizeCalculation, - noUpdateTTL = this.noUpdateTTL, - // fetch exclusive options - noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, - allowStaleOnFetchRejection = this.allowStaleOnFetchRejection, - ignoreFetchAbort = this.ignoreFetchAbort, - allowStaleOnFetchAbort = this.allowStaleOnFetchAbort, - fetchContext = this.fetchContext, - forceRefresh = false, - status, - signal, - } = {} - ) { - if (!this.fetchMethod) { - if (status) status.fetch = 'get' - return this.get(k, { - allowStale, - updateAgeOnGet, - noDeleteOnStaleGet, - status, - }) - } - - const options = { - allowStale, - updateAgeOnGet, - noDeleteOnStaleGet, - ttl, - noDisposeOnSet, - size, - sizeCalculation, - noUpdateTTL, - noDeleteOnFetchRejection, - allowStaleOnFetchRejection, - allowStaleOnFetchAbort, - ignoreFetchAbort, - status, - signal, - } - - let index = this.keyMap.get(k) - if (index === undefined) { - if (status) status.fetch = 'miss' - const p = this.backgroundFetch(k, index, options, fetchContext) - return (p.__returned = p) - } else { - // in cache, maybe already fetching - const v = this.valList[index] - if (this.isBackgroundFetch(v)) { - const stale = - allowStale && v.__staleWhileFetching !== undefined - if (status) { - status.fetch = 'inflight' - if (stale) status.returnedStale = true - } - return stale ? v.__staleWhileFetching : (v.__returned = v) - } - - // if we force a refresh, that means do NOT serve the cached value, - // unless we are already in the process of refreshing the cache. - const isStale = this.isStale(index) - if (!forceRefresh && !isStale) { - if (status) status.fetch = 'hit' - this.moveToTail(index) - if (updateAgeOnGet) { - this.updateItemAge(index) - } - this.statusTTL(status, index) - return v - } - - // ok, it is stale or a forced refresh, and not already fetching. - // refresh the cache. - const p = this.backgroundFetch(k, index, options, fetchContext) - const hasStale = p.__staleWhileFetching !== undefined - const staleVal = hasStale && allowStale - if (status) { - status.fetch = hasStale && isStale ? 'stale' : 'refresh' - if (staleVal && isStale) status.returnedStale = true - } - return staleVal ? p.__staleWhileFetching : (p.__returned = p) - } - } - - get( - k, - { - allowStale = this.allowStale, - updateAgeOnGet = this.updateAgeOnGet, - noDeleteOnStaleGet = this.noDeleteOnStaleGet, - status, - } = {} - ) { - const index = this.keyMap.get(k) - if (index !== undefined) { - const value = this.valList[index] - const fetching = this.isBackgroundFetch(value) - this.statusTTL(status, index) - if (this.isStale(index)) { - if (status) status.get = 'stale' - // delete only if not an in-flight background fetch - if (!fetching) { - if (!noDeleteOnStaleGet) { - this.delete(k) - } - if (status) status.returnedStale = allowStale - return allowStale ? value : undefined - } else { - if (status) { - status.returnedStale = - allowStale && value.__staleWhileFetching !== undefined - } - return allowStale ? value.__staleWhileFetching : undefined - } - } else { - if (status) status.get = 'hit' - // if we're currently fetching it, we don't actually have it yet - // it's not stale, which means this isn't a staleWhileRefetching. - // If it's not stale, and fetching, AND has a __staleWhileFetching - // value, then that means the user fetched with {forceRefresh:true}, - // so it's safe to return that value. - if (fetching) { - return value.__staleWhileFetching - } - this.moveToTail(index) - if (updateAgeOnGet) { - this.updateItemAge(index) - } - return value - } - } else if (status) { - status.get = 'miss' - } - } - - connect(p, n) { - this.prev[n] = p - this.next[p] = n - } - - moveToTail(index) { - // if tail already, nothing to do - // if head, move head to next[index] - // else - // move next[prev[index]] to next[index] (head has no prev) - // move prev[next[index]] to prev[index] - // prev[index] = tail - // next[tail] = index - // tail = index - if (index !== this.tail) { - if (index === this.head) { - this.head = this.next[index] - } else { - this.connect(this.prev[index], this.next[index]) - } - this.connect(this.tail, index) - this.tail = index - } - } - - get del() { - deprecatedMethod('del', 'delete') - return this.delete - } - - delete(k) { - let deleted = false - if (this.size !== 0) { - const index = this.keyMap.get(k) - if (index !== undefined) { - deleted = true - if (this.size === 1) { - this.clear() - } else { - this.removeItemSize(index) - const v = this.valList[index] - if (this.isBackgroundFetch(v)) { - v.__abortController.abort(new Error('deleted')) - } else { - this.dispose(v, k, 'delete') - if (this.disposeAfter) { - this.disposed.push([v, k, 'delete']) - } - } - this.keyMap.delete(k) - this.keyList[index] = null - this.valList[index] = null - if (index === this.tail) { - this.tail = this.prev[index] - } else if (index === this.head) { - this.head = this.next[index] - } else { - this.next[this.prev[index]] = this.next[index] - this.prev[this.next[index]] = this.prev[index] - } - this.size-- - this.free.push(index) - } - } - } - if (this.disposed) { - while (this.disposed.length) { - this.disposeAfter(...this.disposed.shift()) - } - } - return deleted - } - - clear() { - for (const index of this.rindexes({ allowStale: true })) { - const v = this.valList[index] - if (this.isBackgroundFetch(v)) { - v.__abortController.abort(new Error('deleted')) - } else { - const k = this.keyList[index] - this.dispose(v, k, 'delete') - if (this.disposeAfter) { - this.disposed.push([v, k, 'delete']) - } - } - } - - this.keyMap.clear() - this.valList.fill(null) - this.keyList.fill(null) - if (this.ttls) { - this.ttls.fill(0) - this.starts.fill(0) - } - if (this.sizes) { - this.sizes.fill(0) - } - this.head = 0 - this.tail = 0 - this.initialFill = 1 - this.free.length = 0 - this.calculatedSize = 0 - this.size = 0 - if (this.disposed) { - while (this.disposed.length) { - this.disposeAfter(...this.disposed.shift()) - } - } - } - - get reset() { - deprecatedMethod('reset', 'clear') - return this.clear - } - - get length() { - deprecatedProperty('length', 'size') - return this.size - } - - static get AbortController() { - return AC - } - static get AbortSignal() { - return AS - } -} - -module.exports = LRUCache diff --git a/node_modules/path-scurry/node_modules/lru-cache/index.mjs b/node_modules/path-scurry/node_modules/lru-cache/index.mjs deleted file mode 100644 index 4a0b4813ec..0000000000 --- a/node_modules/path-scurry/node_modules/lru-cache/index.mjs +++ /dev/null @@ -1,1227 +0,0 @@ -const perf = - typeof performance === 'object' && - performance && - typeof performance.now === 'function' - ? performance - : Date - -const hasAbortController = typeof AbortController === 'function' - -// minimal backwards-compatibility polyfill -// this doesn't have nearly all the checks and whatnot that -// actual AbortController/Signal has, but it's enough for -// our purposes, and if used properly, behaves the same. -const AC = hasAbortController - ? AbortController - : class AbortController { - constructor() { - this.signal = new AS() - } - abort(reason = new Error('This operation was aborted')) { - this.signal.reason = this.signal.reason || reason - this.signal.aborted = true - this.signal.dispatchEvent({ - type: 'abort', - target: this.signal, - }) - } - } - -const hasAbortSignal = typeof AbortSignal === 'function' -// Some polyfills put this on the AC class, not global -const hasACAbortSignal = typeof AC.AbortSignal === 'function' -const AS = hasAbortSignal - ? AbortSignal - : hasACAbortSignal - ? AC.AbortController - : class AbortSignal { - constructor() { - this.reason = undefined - this.aborted = false - this._listeners = [] - } - dispatchEvent(e) { - if (e.type === 'abort') { - this.aborted = true - this.onabort(e) - this._listeners.forEach(f => f(e), this) - } - } - onabort() {} - addEventListener(ev, fn) { - if (ev === 'abort') { - this._listeners.push(fn) - } - } - removeEventListener(ev, fn) { - if (ev === 'abort') { - this._listeners = this._listeners.filter(f => f !== fn) - } - } - } - -const warned = new Set() -const deprecatedOption = (opt, instead) => { - const code = `LRU_CACHE_OPTION_${opt}` - if (shouldWarn(code)) { - warn(code, `${opt} option`, `options.${instead}`, LRUCache) - } -} -const deprecatedMethod = (method, instead) => { - const code = `LRU_CACHE_METHOD_${method}` - if (shouldWarn(code)) { - const { prototype } = LRUCache - const { get } = Object.getOwnPropertyDescriptor(prototype, method) - warn(code, `${method} method`, `cache.${instead}()`, get) - } -} -const deprecatedProperty = (field, instead) => { - const code = `LRU_CACHE_PROPERTY_${field}` - if (shouldWarn(code)) { - const { prototype } = LRUCache - const { get } = Object.getOwnPropertyDescriptor(prototype, field) - warn(code, `${field} property`, `cache.${instead}`, get) - } -} - -const emitWarning = (...a) => { - typeof process === 'object' && - process && - typeof process.emitWarning === 'function' - ? process.emitWarning(...a) - : console.error(...a) -} - -const shouldWarn = code => !warned.has(code) - -const warn = (code, what, instead, fn) => { - warned.add(code) - const msg = `The ${what} is deprecated. Please use ${instead} instead.` - emitWarning(msg, 'DeprecationWarning', code, fn) -} - -const isPosInt = n => n && n === Math.floor(n) && n > 0 && isFinite(n) - -/* istanbul ignore next - This is a little bit ridiculous, tbh. - * The maximum array length is 2^32-1 or thereabouts on most JS impls. - * And well before that point, you're caching the entire world, I mean, - * that's ~32GB of just integers for the next/prev links, plus whatever - * else to hold that many keys and values. Just filling the memory with - * zeroes at init time is brutal when you get that big. - * But why not be complete? - * Maybe in the future, these limits will have expanded. */ -const getUintArray = max => - !isPosInt(max) - ? null - : max <= Math.pow(2, 8) - ? Uint8Array - : max <= Math.pow(2, 16) - ? Uint16Array - : max <= Math.pow(2, 32) - ? Uint32Array - : max <= Number.MAX_SAFE_INTEGER - ? ZeroArray - : null - -class ZeroArray extends Array { - constructor(size) { - super(size) - this.fill(0) - } -} - -class Stack { - constructor(max) { - if (max === 0) { - return [] - } - const UintArray = getUintArray(max) - this.heap = new UintArray(max) - this.length = 0 - } - push(n) { - this.heap[this.length++] = n - } - pop() { - return this.heap[--this.length] - } -} - -class LRUCache { - constructor(options = {}) { - const { - max = 0, - ttl, - ttlResolution = 1, - ttlAutopurge, - updateAgeOnGet, - updateAgeOnHas, - allowStale, - dispose, - disposeAfter, - noDisposeOnSet, - noUpdateTTL, - maxSize = 0, - maxEntrySize = 0, - sizeCalculation, - fetchMethod, - fetchContext, - noDeleteOnFetchRejection, - noDeleteOnStaleGet, - allowStaleOnFetchRejection, - allowStaleOnFetchAbort, - ignoreFetchAbort, - } = options - - // deprecated options, don't trigger a warning for getting them if - // the thing being passed in is another LRUCache we're copying. - const { length, maxAge, stale } = - options instanceof LRUCache ? {} : options - - if (max !== 0 && !isPosInt(max)) { - throw new TypeError('max option must be a nonnegative integer') - } - - const UintArray = max ? getUintArray(max) : Array - if (!UintArray) { - throw new Error('invalid max value: ' + max) - } - - this.max = max - this.maxSize = maxSize - this.maxEntrySize = maxEntrySize || this.maxSize - this.sizeCalculation = sizeCalculation || length - if (this.sizeCalculation) { - if (!this.maxSize && !this.maxEntrySize) { - throw new TypeError( - 'cannot set sizeCalculation without setting maxSize or maxEntrySize' - ) - } - if (typeof this.sizeCalculation !== 'function') { - throw new TypeError('sizeCalculation set to non-function') - } - } - - this.fetchMethod = fetchMethod || null - if (this.fetchMethod && typeof this.fetchMethod !== 'function') { - throw new TypeError( - 'fetchMethod must be a function if specified' - ) - } - - this.fetchContext = fetchContext - if (!this.fetchMethod && fetchContext !== undefined) { - throw new TypeError( - 'cannot set fetchContext without fetchMethod' - ) - } - - this.keyMap = new Map() - this.keyList = new Array(max).fill(null) - this.valList = new Array(max).fill(null) - this.next = new UintArray(max) - this.prev = new UintArray(max) - this.head = 0 - this.tail = 0 - this.free = new Stack(max) - this.initialFill = 1 - this.size = 0 - - if (typeof dispose === 'function') { - this.dispose = dispose - } - if (typeof disposeAfter === 'function') { - this.disposeAfter = disposeAfter - this.disposed = [] - } else { - this.disposeAfter = null - this.disposed = null - } - this.noDisposeOnSet = !!noDisposeOnSet - this.noUpdateTTL = !!noUpdateTTL - this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection - this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection - this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort - this.ignoreFetchAbort = !!ignoreFetchAbort - - // NB: maxEntrySize is set to maxSize if it's set - if (this.maxEntrySize !== 0) { - if (this.maxSize !== 0) { - if (!isPosInt(this.maxSize)) { - throw new TypeError( - 'maxSize must be a positive integer if specified' - ) - } - } - if (!isPosInt(this.maxEntrySize)) { - throw new TypeError( - 'maxEntrySize must be a positive integer if specified' - ) - } - this.initializeSizeTracking() - } - - this.allowStale = !!allowStale || !!stale - this.noDeleteOnStaleGet = !!noDeleteOnStaleGet - this.updateAgeOnGet = !!updateAgeOnGet - this.updateAgeOnHas = !!updateAgeOnHas - this.ttlResolution = - isPosInt(ttlResolution) || ttlResolution === 0 - ? ttlResolution - : 1 - this.ttlAutopurge = !!ttlAutopurge - this.ttl = ttl || maxAge || 0 - if (this.ttl) { - if (!isPosInt(this.ttl)) { - throw new TypeError( - 'ttl must be a positive integer if specified' - ) - } - this.initializeTTLTracking() - } - - // do not allow completely unbounded caches - if (this.max === 0 && this.ttl === 0 && this.maxSize === 0) { - throw new TypeError( - 'At least one of max, maxSize, or ttl is required' - ) - } - if (!this.ttlAutopurge && !this.max && !this.maxSize) { - const code = 'LRU_CACHE_UNBOUNDED' - if (shouldWarn(code)) { - warned.add(code) - const msg = - 'TTL caching without ttlAutopurge, max, or maxSize can ' + - 'result in unbounded memory consumption.' - emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache) - } - } - - if (stale) { - deprecatedOption('stale', 'allowStale') - } - if (maxAge) { - deprecatedOption('maxAge', 'ttl') - } - if (length) { - deprecatedOption('length', 'sizeCalculation') - } - } - - getRemainingTTL(key) { - return this.has(key, { updateAgeOnHas: false }) ? Infinity : 0 - } - - initializeTTLTracking() { - this.ttls = new ZeroArray(this.max) - this.starts = new ZeroArray(this.max) - - this.setItemTTL = (index, ttl, start = perf.now()) => { - this.starts[index] = ttl !== 0 ? start : 0 - this.ttls[index] = ttl - if (ttl !== 0 && this.ttlAutopurge) { - const t = setTimeout(() => { - if (this.isStale(index)) { - this.delete(this.keyList[index]) - } - }, ttl + 1) - /* istanbul ignore else - unref() not supported on all platforms */ - if (t.unref) { - t.unref() - } - } - } - - this.updateItemAge = index => { - this.starts[index] = this.ttls[index] !== 0 ? perf.now() : 0 - } - - this.statusTTL = (status, index) => { - if (status) { - status.ttl = this.ttls[index] - status.start = this.starts[index] - status.now = cachedNow || getNow() - status.remainingTTL = status.now + status.ttl - status.start - } - } - - // debounce calls to perf.now() to 1s so we're not hitting - // that costly call repeatedly. - let cachedNow = 0 - const getNow = () => { - const n = perf.now() - if (this.ttlResolution > 0) { - cachedNow = n - const t = setTimeout( - () => (cachedNow = 0), - this.ttlResolution - ) - /* istanbul ignore else - not available on all platforms */ - if (t.unref) { - t.unref() - } - } - return n - } - - this.getRemainingTTL = key => { - const index = this.keyMap.get(key) - if (index === undefined) { - return 0 - } - return this.ttls[index] === 0 || this.starts[index] === 0 - ? Infinity - : this.starts[index] + - this.ttls[index] - - (cachedNow || getNow()) - } - - this.isStale = index => { - return ( - this.ttls[index] !== 0 && - this.starts[index] !== 0 && - (cachedNow || getNow()) - this.starts[index] > - this.ttls[index] - ) - } - } - updateItemAge(_index) {} - statusTTL(_status, _index) {} - setItemTTL(_index, _ttl, _start) {} - isStale(_index) { - return false - } - - initializeSizeTracking() { - this.calculatedSize = 0 - this.sizes = new ZeroArray(this.max) - this.removeItemSize = index => { - this.calculatedSize -= this.sizes[index] - this.sizes[index] = 0 - } - this.requireSize = (k, v, size, sizeCalculation) => { - // provisionally accept background fetches. - // actual value size will be checked when they return. - if (this.isBackgroundFetch(v)) { - return 0 - } - if (!isPosInt(size)) { - if (sizeCalculation) { - if (typeof sizeCalculation !== 'function') { - throw new TypeError('sizeCalculation must be a function') - } - size = sizeCalculation(v, k) - if (!isPosInt(size)) { - throw new TypeError( - 'sizeCalculation return invalid (expect positive integer)' - ) - } - } else { - throw new TypeError( - 'invalid size value (must be positive integer). ' + - 'When maxSize or maxEntrySize is used, sizeCalculation or size ' + - 'must be set.' - ) - } - } - return size - } - this.addItemSize = (index, size, status) => { - this.sizes[index] = size - if (this.maxSize) { - const maxSize = this.maxSize - this.sizes[index] - while (this.calculatedSize > maxSize) { - this.evict(true) - } - } - this.calculatedSize += this.sizes[index] - if (status) { - status.entrySize = size - status.totalCalculatedSize = this.calculatedSize - } - } - } - removeItemSize(_index) {} - addItemSize(_index, _size) {} - requireSize(_k, _v, size, sizeCalculation) { - if (size || sizeCalculation) { - throw new TypeError( - 'cannot set size without setting maxSize or maxEntrySize on cache' - ) - } - } - - *indexes({ allowStale = this.allowStale } = {}) { - if (this.size) { - for (let i = this.tail; true; ) { - if (!this.isValidIndex(i)) { - break - } - if (allowStale || !this.isStale(i)) { - yield i - } - if (i === this.head) { - break - } else { - i = this.prev[i] - } - } - } - } - - *rindexes({ allowStale = this.allowStale } = {}) { - if (this.size) { - for (let i = this.head; true; ) { - if (!this.isValidIndex(i)) { - break - } - if (allowStale || !this.isStale(i)) { - yield i - } - if (i === this.tail) { - break - } else { - i = this.next[i] - } - } - } - } - - isValidIndex(index) { - return ( - index !== undefined && - this.keyMap.get(this.keyList[index]) === index - ) - } - - *entries() { - for (const i of this.indexes()) { - if ( - this.valList[i] !== undefined && - this.keyList[i] !== undefined && - !this.isBackgroundFetch(this.valList[i]) - ) { - yield [this.keyList[i], this.valList[i]] - } - } - } - *rentries() { - for (const i of this.rindexes()) { - if ( - this.valList[i] !== undefined && - this.keyList[i] !== undefined && - !this.isBackgroundFetch(this.valList[i]) - ) { - yield [this.keyList[i], this.valList[i]] - } - } - } - - *keys() { - for (const i of this.indexes()) { - if ( - this.keyList[i] !== undefined && - !this.isBackgroundFetch(this.valList[i]) - ) { - yield this.keyList[i] - } - } - } - *rkeys() { - for (const i of this.rindexes()) { - if ( - this.keyList[i] !== undefined && - !this.isBackgroundFetch(this.valList[i]) - ) { - yield this.keyList[i] - } - } - } - - *values() { - for (const i of this.indexes()) { - if ( - this.valList[i] !== undefined && - !this.isBackgroundFetch(this.valList[i]) - ) { - yield this.valList[i] - } - } - } - *rvalues() { - for (const i of this.rindexes()) { - if ( - this.valList[i] !== undefined && - !this.isBackgroundFetch(this.valList[i]) - ) { - yield this.valList[i] - } - } - } - - [Symbol.iterator]() { - return this.entries() - } - - find(fn, getOptions) { - for (const i of this.indexes()) { - const v = this.valList[i] - const value = this.isBackgroundFetch(v) - ? v.__staleWhileFetching - : v - if (value === undefined) continue - if (fn(value, this.keyList[i], this)) { - return this.get(this.keyList[i], getOptions) - } - } - } - - forEach(fn, thisp = this) { - for (const i of this.indexes()) { - const v = this.valList[i] - const value = this.isBackgroundFetch(v) - ? v.__staleWhileFetching - : v - if (value === undefined) continue - fn.call(thisp, value, this.keyList[i], this) - } - } - - rforEach(fn, thisp = this) { - for (const i of this.rindexes()) { - const v = this.valList[i] - const value = this.isBackgroundFetch(v) - ? v.__staleWhileFetching - : v - if (value === undefined) continue - fn.call(thisp, value, this.keyList[i], this) - } - } - - get prune() { - deprecatedMethod('prune', 'purgeStale') - return this.purgeStale - } - - purgeStale() { - let deleted = false - for (const i of this.rindexes({ allowStale: true })) { - if (this.isStale(i)) { - this.delete(this.keyList[i]) - deleted = true - } - } - return deleted - } - - dump() { - const arr = [] - for (const i of this.indexes({ allowStale: true })) { - const key = this.keyList[i] - const v = this.valList[i] - const value = this.isBackgroundFetch(v) - ? v.__staleWhileFetching - : v - if (value === undefined) continue - const entry = { value } - if (this.ttls) { - entry.ttl = this.ttls[i] - // always dump the start relative to a portable timestamp - // it's ok for this to be a bit slow, it's a rare operation. - const age = perf.now() - this.starts[i] - entry.start = Math.floor(Date.now() - age) - } - if (this.sizes) { - entry.size = this.sizes[i] - } - arr.unshift([key, entry]) - } - return arr - } - - load(arr) { - this.clear() - for (const [key, entry] of arr) { - if (entry.start) { - // entry.start is a portable timestamp, but we may be using - // node's performance.now(), so calculate the offset. - // it's ok for this to be a bit slow, it's a rare operation. - const age = Date.now() - entry.start - entry.start = perf.now() - age - } - this.set(key, entry.value, entry) - } - } - - dispose(_v, _k, _reason) {} - - set( - k, - v, - { - ttl = this.ttl, - start, - noDisposeOnSet = this.noDisposeOnSet, - size = 0, - sizeCalculation = this.sizeCalculation, - noUpdateTTL = this.noUpdateTTL, - status, - } = {} - ) { - size = this.requireSize(k, v, size, sizeCalculation) - // if the item doesn't fit, don't do anything - // NB: maxEntrySize set to maxSize by default - if (this.maxEntrySize && size > this.maxEntrySize) { - if (status) { - status.set = 'miss' - status.maxEntrySizeExceeded = true - } - // have to delete, in case a background fetch is there already. - // in non-async cases, this is a no-op - this.delete(k) - return this - } - let index = this.size === 0 ? undefined : this.keyMap.get(k) - if (index === undefined) { - // addition - index = this.newIndex() - this.keyList[index] = k - this.valList[index] = v - this.keyMap.set(k, index) - this.next[this.tail] = index - this.prev[index] = this.tail - this.tail = index - this.size++ - this.addItemSize(index, size, status) - if (status) { - status.set = 'add' - } - noUpdateTTL = false - } else { - // update - this.moveToTail(index) - const oldVal = this.valList[index] - if (v !== oldVal) { - if (this.isBackgroundFetch(oldVal)) { - oldVal.__abortController.abort(new Error('replaced')) - } else { - if (!noDisposeOnSet) { - this.dispose(oldVal, k, 'set') - if (this.disposeAfter) { - this.disposed.push([oldVal, k, 'set']) - } - } - } - this.removeItemSize(index) - this.valList[index] = v - this.addItemSize(index, size, status) - if (status) { - status.set = 'replace' - const oldValue = - oldVal && this.isBackgroundFetch(oldVal) - ? oldVal.__staleWhileFetching - : oldVal - if (oldValue !== undefined) status.oldValue = oldValue - } - } else if (status) { - status.set = 'update' - } - } - if (ttl !== 0 && this.ttl === 0 && !this.ttls) { - this.initializeTTLTracking() - } - if (!noUpdateTTL) { - this.setItemTTL(index, ttl, start) - } - this.statusTTL(status, index) - if (this.disposeAfter) { - while (this.disposed.length) { - this.disposeAfter(...this.disposed.shift()) - } - } - return this - } - - newIndex() { - if (this.size === 0) { - return this.tail - } - if (this.size === this.max && this.max !== 0) { - return this.evict(false) - } - if (this.free.length !== 0) { - return this.free.pop() - } - // initial fill, just keep writing down the list - return this.initialFill++ - } - - pop() { - if (this.size) { - const val = this.valList[this.head] - this.evict(true) - return val - } - } - - evict(free) { - const head = this.head - const k = this.keyList[head] - const v = this.valList[head] - if (this.isBackgroundFetch(v)) { - v.__abortController.abort(new Error('evicted')) - } else { - this.dispose(v, k, 'evict') - if (this.disposeAfter) { - this.disposed.push([v, k, 'evict']) - } - } - this.removeItemSize(head) - // if we aren't about to use the index, then null these out - if (free) { - this.keyList[head] = null - this.valList[head] = null - this.free.push(head) - } - this.head = this.next[head] - this.keyMap.delete(k) - this.size-- - return head - } - - has(k, { updateAgeOnHas = this.updateAgeOnHas, status } = {}) { - const index = this.keyMap.get(k) - if (index !== undefined) { - if (!this.isStale(index)) { - if (updateAgeOnHas) { - this.updateItemAge(index) - } - if (status) status.has = 'hit' - this.statusTTL(status, index) - return true - } else if (status) { - status.has = 'stale' - this.statusTTL(status, index) - } - } else if (status) { - status.has = 'miss' - } - return false - } - - // like get(), but without any LRU updating or TTL expiration - peek(k, { allowStale = this.allowStale } = {}) { - const index = this.keyMap.get(k) - if (index !== undefined && (allowStale || !this.isStale(index))) { - const v = this.valList[index] - // either stale and allowed, or forcing a refresh of non-stale value - return this.isBackgroundFetch(v) ? v.__staleWhileFetching : v - } - } - - backgroundFetch(k, index, options, context) { - const v = index === undefined ? undefined : this.valList[index] - if (this.isBackgroundFetch(v)) { - return v - } - const ac = new AC() - if (options.signal) { - options.signal.addEventListener('abort', () => - ac.abort(options.signal.reason) - ) - } - const fetchOpts = { - signal: ac.signal, - options, - context, - } - const cb = (v, updateCache = false) => { - const { aborted } = ac.signal - const ignoreAbort = options.ignoreFetchAbort && v !== undefined - if (options.status) { - if (aborted && !updateCache) { - options.status.fetchAborted = true - options.status.fetchError = ac.signal.reason - if (ignoreAbort) options.status.fetchAbortIgnored = true - } else { - options.status.fetchResolved = true - } - } - if (aborted && !ignoreAbort && !updateCache) { - return fetchFail(ac.signal.reason) - } - // either we didn't abort, and are still here, or we did, and ignored - if (this.valList[index] === p) { - if (v === undefined) { - if (p.__staleWhileFetching) { - this.valList[index] = p.__staleWhileFetching - } else { - this.delete(k) - } - } else { - if (options.status) options.status.fetchUpdated = true - this.set(k, v, fetchOpts.options) - } - } - return v - } - const eb = er => { - if (options.status) { - options.status.fetchRejected = true - options.status.fetchError = er - } - return fetchFail(er) - } - const fetchFail = er => { - const { aborted } = ac.signal - const allowStaleAborted = - aborted && options.allowStaleOnFetchAbort - const allowStale = - allowStaleAborted || options.allowStaleOnFetchRejection - const noDelete = allowStale || options.noDeleteOnFetchRejection - if (this.valList[index] === p) { - // if we allow stale on fetch rejections, then we need to ensure that - // the stale value is not removed from the cache when the fetch fails. - const del = !noDelete || p.__staleWhileFetching === undefined - if (del) { - this.delete(k) - } else if (!allowStaleAborted) { - // still replace the *promise* with the stale value, - // since we are done with the promise at this point. - // leave it untouched if we're still waiting for an - // aborted background fetch that hasn't yet returned. - this.valList[index] = p.__staleWhileFetching - } - } - if (allowStale) { - if (options.status && p.__staleWhileFetching !== undefined) { - options.status.returnedStale = true - } - return p.__staleWhileFetching - } else if (p.__returned === p) { - throw er - } - } - const pcall = (res, rej) => { - this.fetchMethod(k, v, fetchOpts).then(v => res(v), rej) - // ignored, we go until we finish, regardless. - // defer check until we are actually aborting, - // so fetchMethod can override. - ac.signal.addEventListener('abort', () => { - if ( - !options.ignoreFetchAbort || - options.allowStaleOnFetchAbort - ) { - res() - // when it eventually resolves, update the cache. - if (options.allowStaleOnFetchAbort) { - res = v => cb(v, true) - } - } - }) - } - if (options.status) options.status.fetchDispatched = true - const p = new Promise(pcall).then(cb, eb) - p.__abortController = ac - p.__staleWhileFetching = v - p.__returned = null - if (index === undefined) { - // internal, don't expose status. - this.set(k, p, { ...fetchOpts.options, status: undefined }) - index = this.keyMap.get(k) - } else { - this.valList[index] = p - } - return p - } - - isBackgroundFetch(p) { - return ( - p && - typeof p === 'object' && - typeof p.then === 'function' && - Object.prototype.hasOwnProperty.call( - p, - '__staleWhileFetching' - ) && - Object.prototype.hasOwnProperty.call(p, '__returned') && - (p.__returned === p || p.__returned === null) - ) - } - - // this takes the union of get() and set() opts, because it does both - async fetch( - k, - { - // get options - allowStale = this.allowStale, - updateAgeOnGet = this.updateAgeOnGet, - noDeleteOnStaleGet = this.noDeleteOnStaleGet, - // set options - ttl = this.ttl, - noDisposeOnSet = this.noDisposeOnSet, - size = 0, - sizeCalculation = this.sizeCalculation, - noUpdateTTL = this.noUpdateTTL, - // fetch exclusive options - noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, - allowStaleOnFetchRejection = this.allowStaleOnFetchRejection, - ignoreFetchAbort = this.ignoreFetchAbort, - allowStaleOnFetchAbort = this.allowStaleOnFetchAbort, - fetchContext = this.fetchContext, - forceRefresh = false, - status, - signal, - } = {} - ) { - if (!this.fetchMethod) { - if (status) status.fetch = 'get' - return this.get(k, { - allowStale, - updateAgeOnGet, - noDeleteOnStaleGet, - status, - }) - } - - const options = { - allowStale, - updateAgeOnGet, - noDeleteOnStaleGet, - ttl, - noDisposeOnSet, - size, - sizeCalculation, - noUpdateTTL, - noDeleteOnFetchRejection, - allowStaleOnFetchRejection, - allowStaleOnFetchAbort, - ignoreFetchAbort, - status, - signal, - } - - let index = this.keyMap.get(k) - if (index === undefined) { - if (status) status.fetch = 'miss' - const p = this.backgroundFetch(k, index, options, fetchContext) - return (p.__returned = p) - } else { - // in cache, maybe already fetching - const v = this.valList[index] - if (this.isBackgroundFetch(v)) { - const stale = - allowStale && v.__staleWhileFetching !== undefined - if (status) { - status.fetch = 'inflight' - if (stale) status.returnedStale = true - } - return stale ? v.__staleWhileFetching : (v.__returned = v) - } - - // if we force a refresh, that means do NOT serve the cached value, - // unless we are already in the process of refreshing the cache. - const isStale = this.isStale(index) - if (!forceRefresh && !isStale) { - if (status) status.fetch = 'hit' - this.moveToTail(index) - if (updateAgeOnGet) { - this.updateItemAge(index) - } - this.statusTTL(status, index) - return v - } - - // ok, it is stale or a forced refresh, and not already fetching. - // refresh the cache. - const p = this.backgroundFetch(k, index, options, fetchContext) - const hasStale = p.__staleWhileFetching !== undefined - const staleVal = hasStale && allowStale - if (status) { - status.fetch = hasStale && isStale ? 'stale' : 'refresh' - if (staleVal && isStale) status.returnedStale = true - } - return staleVal ? p.__staleWhileFetching : (p.__returned = p) - } - } - - get( - k, - { - allowStale = this.allowStale, - updateAgeOnGet = this.updateAgeOnGet, - noDeleteOnStaleGet = this.noDeleteOnStaleGet, - status, - } = {} - ) { - const index = this.keyMap.get(k) - if (index !== undefined) { - const value = this.valList[index] - const fetching = this.isBackgroundFetch(value) - this.statusTTL(status, index) - if (this.isStale(index)) { - if (status) status.get = 'stale' - // delete only if not an in-flight background fetch - if (!fetching) { - if (!noDeleteOnStaleGet) { - this.delete(k) - } - if (status) status.returnedStale = allowStale - return allowStale ? value : undefined - } else { - if (status) { - status.returnedStale = - allowStale && value.__staleWhileFetching !== undefined - } - return allowStale ? value.__staleWhileFetching : undefined - } - } else { - if (status) status.get = 'hit' - // if we're currently fetching it, we don't actually have it yet - // it's not stale, which means this isn't a staleWhileRefetching. - // If it's not stale, and fetching, AND has a __staleWhileFetching - // value, then that means the user fetched with {forceRefresh:true}, - // so it's safe to return that value. - if (fetching) { - return value.__staleWhileFetching - } - this.moveToTail(index) - if (updateAgeOnGet) { - this.updateItemAge(index) - } - return value - } - } else if (status) { - status.get = 'miss' - } - } - - connect(p, n) { - this.prev[n] = p - this.next[p] = n - } - - moveToTail(index) { - // if tail already, nothing to do - // if head, move head to next[index] - // else - // move next[prev[index]] to next[index] (head has no prev) - // move prev[next[index]] to prev[index] - // prev[index] = tail - // next[tail] = index - // tail = index - if (index !== this.tail) { - if (index === this.head) { - this.head = this.next[index] - } else { - this.connect(this.prev[index], this.next[index]) - } - this.connect(this.tail, index) - this.tail = index - } - } - - get del() { - deprecatedMethod('del', 'delete') - return this.delete - } - - delete(k) { - let deleted = false - if (this.size !== 0) { - const index = this.keyMap.get(k) - if (index !== undefined) { - deleted = true - if (this.size === 1) { - this.clear() - } else { - this.removeItemSize(index) - const v = this.valList[index] - if (this.isBackgroundFetch(v)) { - v.__abortController.abort(new Error('deleted')) - } else { - this.dispose(v, k, 'delete') - if (this.disposeAfter) { - this.disposed.push([v, k, 'delete']) - } - } - this.keyMap.delete(k) - this.keyList[index] = null - this.valList[index] = null - if (index === this.tail) { - this.tail = this.prev[index] - } else if (index === this.head) { - this.head = this.next[index] - } else { - this.next[this.prev[index]] = this.next[index] - this.prev[this.next[index]] = this.prev[index] - } - this.size-- - this.free.push(index) - } - } - } - if (this.disposed) { - while (this.disposed.length) { - this.disposeAfter(...this.disposed.shift()) - } - } - return deleted - } - - clear() { - for (const index of this.rindexes({ allowStale: true })) { - const v = this.valList[index] - if (this.isBackgroundFetch(v)) { - v.__abortController.abort(new Error('deleted')) - } else { - const k = this.keyList[index] - this.dispose(v, k, 'delete') - if (this.disposeAfter) { - this.disposed.push([v, k, 'delete']) - } - } - } - - this.keyMap.clear() - this.valList.fill(null) - this.keyList.fill(null) - if (this.ttls) { - this.ttls.fill(0) - this.starts.fill(0) - } - if (this.sizes) { - this.sizes.fill(0) - } - this.head = 0 - this.tail = 0 - this.initialFill = 1 - this.free.length = 0 - this.calculatedSize = 0 - this.size = 0 - if (this.disposed) { - while (this.disposed.length) { - this.disposeAfter(...this.disposed.shift()) - } - } - } - - get reset() { - deprecatedMethod('reset', 'clear') - return this.clear - } - - get length() { - deprecatedProperty('length', 'size') - return this.size - } - - static get AbortController() { - return AC - } - static get AbortSignal() { - return AS - } -} - -export default LRUCache diff --git a/node_modules/path-scurry/node_modules/lru-cache/package.json b/node_modules/path-scurry/node_modules/lru-cache/package.json deleted file mode 100644 index 9684991727..0000000000 --- a/node_modules/path-scurry/node_modules/lru-cache/package.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "name": "lru-cache", - "description": "A cache object that deletes the least-recently-used items.", - "version": "7.18.3", - "author": "Isaac Z. Schlueter ", - "keywords": [ - "mru", - "lru", - "cache" - ], - "sideEffects": false, - "scripts": { - "build": "npm run prepare", - "pretest": "npm run prepare", - "presnap": "npm run prepare", - "prepare": "node ./scripts/transpile-to-esm.js", - "size": "size-limit", - "test": "tap", - "snap": "tap", - "preversion": "npm test", - "postversion": "npm publish", - "prepublishOnly": "git push origin --follow-tags", - "format": "prettier --write .", - "typedoc": "typedoc ./index.d.ts" - }, - "type": "commonjs", - "main": "./index.js", - "module": "./index.mjs", - "types": "./index.d.ts", - "exports": { - ".": { - "import": { - "types": "./index.d.ts", - "default": "./index.mjs" - }, - "require": { - "types": "./index.d.ts", - "default": "./index.js" - } - }, - "./package.json": "./package.json" - }, - "repository": "git://github.com/isaacs/node-lru-cache.git", - "devDependencies": { - "@size-limit/preset-small-lib": "^7.0.8", - "@types/node": "^17.0.31", - "@types/tap": "^15.0.6", - "benchmark": "^2.1.4", - "c8": "^7.11.2", - "clock-mock": "^1.0.6", - "eslint-config-prettier": "^8.5.0", - "prettier": "^2.6.2", - "size-limit": "^7.0.8", - "tap": "^16.3.4", - "ts-node": "^10.7.0", - "tslib": "^2.4.0", - "typedoc": "^0.23.24", - "typescript": "^4.6.4" - }, - "license": "ISC", - "files": [ - "index.js", - "index.mjs", - "index.d.ts" - ], - "engines": { - "node": ">=12" - }, - "prettier": { - "semi": false, - "printWidth": 70, - "tabWidth": 2, - "useTabs": false, - "singleQuote": true, - "jsxSingleQuote": false, - "bracketSameLine": true, - "arrowParens": "avoid", - "endOfLine": "lf" - }, - "tap": { - "nyc-arg": [ - "--include=index.js" - ], - "node-arg": [ - "--expose-gc", - "--require", - "ts-node/register" - ], - "ts": false - }, - "size-limit": [ - { - "path": "./index.js" - } - ] -} diff --git a/node_modules/path-scurry/package.json b/node_modules/path-scurry/package.json deleted file mode 100644 index d19262f659..0000000000 --- a/node_modules/path-scurry/package.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "name": "path-scurry", - "version": "1.6.1", - "description": "walk paths fast and efficiently", - "author": "Isaac Z. Schlueter (https://blog.izs.me)", - "main": "./dist/cjs/index.js", - "module": "./dist/mjs/index.js", - "exports": { - ".": { - "import": { - "types": "./dist/mjs/index.d.ts", - "default": "./dist/mjs/index.js" - }, - "require": { - "types": "./dist/cjs/index.d.ts", - "default": "./dist/cjs/index.js" - } - } - }, - "files": [ - "dist" - ], - "license": "BlueOak-1.0.0", - "scripts": { - "preversion": "npm test", - "postversion": "npm publish", - "prepublishOnly": "git push origin --follow-tags", - "preprepare": "rm -rf dist", - "prepare": "tsc -p tsconfig.json && tsc -p tsconfig-esm.json", - "postprepare": "bash ./scripts/fixup.sh", - "pretest": "npm run prepare", - "presnap": "npm run prepare", - "test": "c8 tap", - "snap": "c8 tap", - "format": "prettier --write . --loglevel warn", - "typedoc": "typedoc --tsconfig tsconfig-esm.json ./src/*.ts", - "bench": "bash ./scripts/bench.sh" - }, - "prettier": { - "semi": false, - "printWidth": 75, - "tabWidth": 2, - "useTabs": false, - "singleQuote": true, - "jsxSingleQuote": false, - "bracketSameLine": true, - "arrowParens": "avoid", - "endOfLine": "lf" - }, - "tap": { - "coverage": false, - "node-arg": [ - "--no-warnings", - "--loader", - "ts-node/esm" - ], - "ts": false - }, - "devDependencies": { - "@nodelib/fs.walk": "^1.2.8", - "@types/node": "^18.11.18", - "@types/tap": "^15.0.7", - "c8": "^7.12.0", - "eslint-config-prettier": "^8.6.0", - "mkdirp": "^2.1.3", - "prettier": "^2.8.3", - "rimraf": "^4.1.2", - "tap": "^16.3.4", - "ts-node": "^10.9.1", - "typedoc": "^0.23.24", - "typescript": "^4.9.4" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/isaacs/path-walker" - }, - "dependencies": { - "lru-cache": "^7.14.1", - "minipass": "^4.0.2" - } -} diff --git a/node_modules/xml2js/README.md b/node_modules/xml2js/README.md index 7534c89332..67f2104a51 100644 --- a/node_modules/xml2js/README.md +++ b/node_modules/xml2js/README.md @@ -113,7 +113,7 @@ var xml = ''; // With parser var parser = new xml2js.Parser(/* options */); -parser.parseStringPromise(data).then(function (result) { +parser.parseStringPromise(xml).then(function (result) { console.dir(result); console.log('Done'); }) @@ -122,7 +122,7 @@ parser.parseStringPromise(data).then(function (result) { }); // Without parser -xml2js.parseStringPromise(data /*, options */).then(function (result) { +xml2js.parseStringPromise(xml /*, options */).then(function (result) { console.dir(result); console.log('Done'); }) @@ -180,6 +180,16 @@ var obj = {name: "Super", Surname: "Man", age: 23}; var builder = new xml2js.Builder(); var xml = builder.buildObject(obj); ``` +will result in: + +```xml + + + Super + Man + 23 + +``` At the moment, a one to one bi-directional conversion is guaranteed only for default configuration, except for `attrkey`, `charkey` and `explicitArray` options @@ -195,6 +205,11 @@ var obj = {root: {$: {id: "my id"}, _: "my inner text"}}; var builder = new xml2js.Builder(); var xml = builder.buildObject(obj); ``` +will result in: +```xml + +my inner text +``` ### Adding xmlns attributes @@ -309,14 +324,18 @@ value})``. Possible options are: Version 0.1 default was `@`. * `charkey` (default: `_`): Prefix that is used to access the character content. Version 0.1 default was `#`. - * `explicitCharkey` (default: `false`) + * `explicitCharkey` (default: `false`) Determines whether or not to use + a `charkey` prefix for elements with no attributes. * `trim` (default: `false`): Trim the whitespace at the beginning and end of text nodes. * `normalizeTags` (default: `false`): Normalize all tag names to lowercase. * `normalize` (default: `false`): Trim whitespaces inside text nodes. * `explicitRoot` (default: `true`): Set this if you want to get the root node in the resulting object. - * `emptyTag` (default: `''`): what will the value of empty nodes be. + * `emptyTag` (default: `''`): what will the value of empty nodes be. In case + you want to use an empty object as a default value, it is better to provide a factory + function `() => ({})` instead. Without this function a plain object would + become a shared reference across all occurrences with unwanted behavior. * `explicitArray` (default: `true`): Always put child nodes in an array if true; otherwise an array is created only if there is more than one. * `ignoreAttrs` (default: `false`): Ignore all XML attributes and only create diff --git a/node_modules/xml2js/lib/parser.js b/node_modules/xml2js/lib/parser.js index 59f4d545f9..192382d3c4 100644 --- a/node_modules/xml2js/lib/parser.js +++ b/node_modules/xml2js/lib/parser.js @@ -141,14 +141,14 @@ this.saxParser.onopentag = (function(_this) { return function(node) { var key, newValue, obj, processedKey, ref; - obj = {}; + obj = Object.create(null); obj[charkey] = ""; if (!_this.options.ignoreAttrs) { ref = node.attributes; for (key in ref) { if (!hasProp.call(ref, key)) continue; if (!(attrkey in obj) && !_this.options.mergeAttrs) { - obj[attrkey] = {}; + obj[attrkey] = Object.create(null); } newValue = _this.options.attrValueProcessors ? processItem(_this.options.attrValueProcessors, node.attributes[key], key) : node.attributes[key]; processedKey = _this.options.attrNameProcessors ? processItem(_this.options.attrNameProcessors, key) : key; @@ -198,7 +198,11 @@ } } if (isEmpty(obj)) { - obj = _this.options.emptyTag !== '' ? _this.options.emptyTag : emptyStr; + if (typeof _this.options.emptyTag === 'function') { + obj = _this.options.emptyTag(); + } else { + obj = _this.options.emptyTag !== '' ? _this.options.emptyTag : emptyStr; + } } if (_this.options.validator != null) { xpath = "/" + ((function() { @@ -222,7 +226,7 @@ } if (_this.options.explicitChildren && !_this.options.mergeAttrs && typeof obj === 'object') { if (!_this.options.preserveChildrenOrder) { - node = {}; + node = Object.create(null); if (_this.options.attrkey in obj) { node[_this.options.attrkey] = obj[_this.options.attrkey]; delete obj[_this.options.attrkey]; @@ -237,7 +241,7 @@ obj = node; } else if (s) { s[_this.options.childkey] = s[_this.options.childkey] || []; - objClone = {}; + objClone = Object.create(null); for (key in obj) { if (!hasProp.call(obj, key)) continue; objClone[key] = obj[key]; @@ -254,7 +258,7 @@ } else { if (_this.options.explicitRoot) { old = obj; - obj = {}; + obj = Object.create(null); obj[nodeName] = old; } _this.resultObject = obj; diff --git a/node_modules/xml2js/package.json b/node_modules/xml2js/package.json index 0769b61152..bc8eb6639f 100644 --- a/node_modules/xml2js/package.json +++ b/node_modules/xml2js/package.json @@ -6,7 +6,7 @@ "json" ], "homepage": "https://github.com/Leonidas-from-XIV/node-xml2js", - "version": "0.4.23", + "version": "0.5.0", "author": "Marek Kubica (https://xivilization.net)", "contributors": [ "maqr (https://github.com/maqr)", @@ -53,7 +53,8 @@ "David Wood (http://codesleuth.co.uk/)", "Nicolas Maquet (https://github.com/nmaquet)", "Lovell Fuller (http://lovell.info/)", - "d3adc0d3 (https://github.com/d3adc0d3)" + "d3adc0d3 (https://github.com/d3adc0d3)", + "James Crosby (https://github.com/autopulated)" ], "main": "./lib/xml2js", "files": [ diff --git a/package-lock.json b/package-lock.json index 6153b1eca4..eae81dead4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,18 +22,15 @@ "@schemastore/package": "^0.0.6", "@types/uuid": "^9.0.0", "adm-zip": "^0.5.9", - "commander": "^8.1.0", "console-log-level": "^1.4.1", "del": "^6.0.0", "fast-deep-equal": "^3.1.3", "file-url": "^3.0.0", "fs": "0.0.1-security", "get-folder-size": "^2.0.1", - "glob": "^9.2.1", "js-yaml": "^4.1.0", "jsonschema": "1.2.6", "long": "^5.2.0", - "md5": "^2.3.0", "path": "^0.12.7", "semver": "^7.3.2", "uuid": "^9.0.0", @@ -1831,13 +1828,6 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/charenc": { - "version": "0.0.2", - "integrity": "sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc=", - "engines": { - "node": "*" - } - }, "node_modules/chokidar": { "version": "3.5.3", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", @@ -2027,14 +2017,6 @@ "node": ">= 0.8" } }, - "node_modules/commander": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-8.1.0.tgz", - "integrity": "sha512-mf45ldcuHSYShkplHHGKWb4TrmwQadxOn7v4WuhDJy0ZVoY5JFajaRDKD0PNe5qXzBX0rhovjTnP6Kz9LETcuA==", - "engines": { - "node": ">= 12" - } - }, "node_modules/common-path-prefix": { "version": "3.0.0", "integrity": "sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==", @@ -2090,13 +2072,6 @@ "node": ">= 8" } }, - "node_modules/crypt": { - "version": "0.0.2", - "integrity": "sha1-iNf/fsDfuG9xPch7u0LQRNPmxBs=", - "engines": { - "node": "*" - } - }, "node_modules/currently-unhandled": { "version": "0.4.1", "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", @@ -3495,23 +3470,6 @@ "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" } }, - "node_modules/glob": { - "version": "9.2.1", - "resolved": "https://registry.npmjs.org/glob/-/glob-9.2.1.tgz", - "integrity": "sha512-Pxxgq3W0HyA3XUvSXcFhRSs+43Jsx0ddxcFrbjxNGkL2Ak5BAUBxLqI5G6ADDeCHLfzzXFhe0b1yYcctGmytMA==", - "dependencies": { - "fs.realpath": "^1.0.0", - "minimatch": "^7.4.1", - "minipass": "^4.2.4", - "path-scurry": "^1.6.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/glob-parent": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", @@ -3523,28 +3481,6 @@ "node": ">= 6" } }, - "node_modules/glob/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/glob/node_modules/minimatch": { - "version": "7.4.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-7.4.2.tgz", - "integrity": "sha512-xy4q7wou3vUoC9k1xGTXc+awNdGaGVHtFUaey8tiX4H1QRc04DZ/rmDFwNm2EBsuYEhAZ6SgMmYf3InGY6OauA==", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/globals": { "version": "13.19.0", "resolved": "https://registry.npmjs.org/globals/-/globals-13.19.0.tgz", @@ -3880,10 +3816,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-buffer": { - "version": "1.1.6", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" - }, "node_modules/is-callable": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", @@ -4446,16 +4378,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/md5": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/md5/-/md5-2.3.0.tgz", - "integrity": "sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==", - "dependencies": { - "charenc": "0.0.2", - "crypt": "0.0.2", - "is-buffer": "~1.1.6" - } - }, "node_modules/md5-hex": { "version": "3.0.1", "integrity": "sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==", @@ -4560,14 +4482,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/minipass": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-4.2.4.tgz", - "integrity": "sha512-lwycX3cBMTvcejsHITUgYj6Gy6A7Nh4Q6h9NP4sTHY1ccJlC7yKzDmiShEHsJ16Jf1nKGDEaiHxiltsJEvk0nQ==", - "engines": { - "node": ">=8" - } - }, "node_modules/ms": { "version": "2.1.2", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", @@ -4997,29 +4911,6 @@ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true }, - "node_modules/path-scurry": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.6.1.tgz", - "integrity": "sha512-OW+5s+7cw6253Q4E+8qQ/u1fVvcJQCJo/VFD8pje+dbJCF1n5ZRMV2AEHbGp+5Q7jxQIYJxkHopnj6nzdGeZLA==", - "dependencies": { - "lru-cache": "^7.14.1", - "minipass": "^4.0.2" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/path-scurry/node_modules/lru-cache": { - "version": "7.18.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", - "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", - "engines": { - "node": ">=12" - } - }, "node_modules/path-to-regexp": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", @@ -6210,9 +6101,9 @@ } }, "node_modules/xml2js": { - "version": "0.4.23", - "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz", - "integrity": "sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.5.0.tgz", + "integrity": "sha512-drPFnkQJik/O+uPKpqSgr22mpuFHqKdbS835iAQrUC73L2F5WkboIRd63ai/2Yg6I1jzifPFKH2NTK+cfglkIA==", "dependencies": { "sax": ">=0.6.0", "xmlbuilder": "~11.0.0" diff --git a/package.json b/package.json index 90b435cb4d..4f709a988f 100644 --- a/package.json +++ b/package.json @@ -34,18 +34,15 @@ "@schemastore/package": "^0.0.6", "@types/uuid": "^9.0.0", "adm-zip": "^0.5.9", - "commander": "^8.1.0", "console-log-level": "^1.4.1", "del": "^6.0.0", "fast-deep-equal": "^3.1.3", "file-url": "^3.0.0", "fs": "0.0.1-security", "get-folder-size": "^2.0.1", - "glob": "^9.2.1", "js-yaml": "^4.1.0", "jsonschema": "1.2.6", "long": "^5.2.0", - "md5": "^2.3.0", "path": "^0.12.7", "semver": "^7.3.2", "uuid": "^9.0.0", @@ -77,7 +74,7 @@ "sinon": "^15.0.1", "typescript": "^5.0.2" }, - "resolutions": { - "glob-parent": ">=5.1.2" + "overrides": { + "xml2js": ">=0.5.0" } } diff --git a/src/actions-util.ts b/src/actions-util.ts index a5dce8c59f..75c312b453 100644 --- a/src/actions-util.ts +++ b/src/actions-util.ts @@ -21,7 +21,7 @@ import { parseMatrixInput, UserError, } from "./util"; -import { getWorkflowPath } from "./workflow"; +import { getWorkflowRelativePath } from "./workflow"; // eslint-disable-next-line import/no-commonjs const pkg = require("../package.json") as JSONSchemaForNPMPackageJsonFiles; @@ -174,7 +174,7 @@ export async function getAnalysisKey(): Promise { return analysisKey; } - const workflowPath = await getWorkflowPath(); + const workflowPath = await getWorkflowRelativePath(); const jobName = getRequiredEnvParam("GITHUB_JOB"); analysisKey = `${workflowPath}:${jobName}`; diff --git a/src/init-action-post-helper.ts b/src/init-action-post-helper.ts index 6de890d55d..4835345c62 100644 --- a/src/init-action-post-helper.ts +++ b/src/init-action-post-helper.ts @@ -57,7 +57,7 @@ async function maybeUploadFailedSarif( if (!(await features.getValue(Feature.UploadFailedSarifEnabled, codeql))) { return { upload_failed_run_skipped_because: "Feature disabled" }; } - const workflow = await getWorkflow(); + const workflow = await getWorkflow(logger); const jobName = getRequiredEnvParam("GITHUB_JOB"); const matrix = parseMatrixInput(actionsUtil.getRequiredInput("matrix")); const shouldUpload = getUploadInputOrThrow(workflow, jobName, matrix); diff --git a/src/init-action.ts b/src/init-action.ts index 99ef3f62de..1207367482 100644 --- a/src/init-action.ts +++ b/src/init-action.ts @@ -213,7 +213,7 @@ async function run() { ); try { - const workflowErrors = await validateWorkflow(); + const workflowErrors = await validateWorkflow(logger); if ( !(await sendStatusReport( diff --git a/src/workflow.ts b/src/workflow.ts index 56bcedcf1b..fb70b8fcc2 100644 --- a/src/workflow.ts +++ b/src/workflow.ts @@ -1,10 +1,12 @@ import * as fs from "fs"; import * as path from "path"; +import zlib from "zlib"; import * as core from "@actions/core"; import * as yaml from "js-yaml"; import * as api from "./api-client"; +import { Logger } from "./logging"; import { getRequiredEnvParam } from "./util"; export interface WorkflowJobStep { @@ -195,10 +197,12 @@ export function getWorkflowErrors(doc: Workflow): CodedError[] { return errors; } -export async function validateWorkflow(): Promise { +export async function validateWorkflow( + logger: Logger +): Promise { let workflow: Workflow; try { - workflow = await getWorkflow(); + workflow = await getWorkflow(logger); } catch (e) { return `error: getWorkflow() failed: ${String(e)}`; } @@ -237,30 +241,52 @@ export function formatWorkflowCause(errors: CodedError[]): undefined | string { return errors.map((e) => e.code).join(","); } -export async function getWorkflow(): Promise { - const relativePath = await getWorkflowPath(); +export async function getWorkflow(logger: Logger): Promise { + // In default setup, the currently executing workflow is not checked into the repository. + // Instead, a gzipped then base64 encoded version of the workflow file is provided via the + // `CODE_SCANNING_WORKFLOW_FILE` environment variable. + const maybeWorkflow = process.env["CODE_SCANNING_WORKFLOW_FILE"]; + if (maybeWorkflow) { + logger.debug( + "Using the workflow specified by the CODE_SCANNING_WORKFLOW_FILE environment variable." + ); + return yaml.load( + zlib.gunzipSync(Buffer.from(maybeWorkflow, "base64")).toString() + ) as Workflow; + } + + const workflowPath = await getWorkflowAbsolutePath(logger); + return yaml.load(fs.readFileSync(workflowPath, "utf-8")) as Workflow; +} + +/** + * Get the absolute path of the currently executing workflow. + */ +async function getWorkflowAbsolutePath(logger: Logger): Promise { + const relativePath = await getWorkflowRelativePath(); const absolutePath = path.join( getRequiredEnvParam("GITHUB_WORKSPACE"), relativePath ); - try { - return yaml.load(fs.readFileSync(absolutePath, "utf-8")) as Workflow; - } catch (e) { - if (e instanceof Error && e["code"] === "ENOENT") { - throw new Error( - `Unable to load code scanning workflow from ${absolutePath}. This can happen if the currently ` + - "running workflow checks out a branch that doesn't contain the corresponding workflow file." - ); - } - throw e; + if (fs.existsSync(absolutePath)) { + logger.debug( + `Derived the following absolute path for the currently executing workflow: ${absolutePath}.` + ); + return absolutePath; } + + throw new Error( + `Expected to find a code scanning workflow file at ${absolutePath}, but no such file existed. ` + + "This can happen if the currently running workflow checks out a branch that doesn't contain " + + "the corresponding workflow file." + ); } /** - * Get the path of the currently executing workflow. + * Get the path of the currently executing workflow relative to the repository root. */ -export async function getWorkflowPath(): Promise { +export async function getWorkflowRelativePath(): Promise { const repo_nwo = getRequiredEnvParam("GITHUB_REPOSITORY").split("/"); const owner = repo_nwo[0]; const repo = repo_nwo[1];