@salesforce/cli 2.159.0 → 2.159.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -12
- package/node_modules/@oclif/plugin-plugins/README.md +7 -7
- package/node_modules/@oclif/plugin-plugins/oclif.manifest.json +1 -1
- package/node_modules/@oclif/plugin-plugins/package.json +7 -7
- package/node_modules/@opentelemetry/core/dist/common/attributes.cjs +5 -0
- package/node_modules/@opentelemetry/core/dist/common/attributes.cjs.map +1 -1
- package/node_modules/@opentelemetry/core/dist/common/attributes.mjs +5 -0
- package/node_modules/@opentelemetry/core/dist/common/attributes.mjs.map +1 -1
- package/node_modules/@opentelemetry/core/dist/version.cjs +1 -1
- package/node_modules/@opentelemetry/core/dist/version.cjs.map +1 -1
- package/node_modules/@opentelemetry/core/dist/version.mjs +1 -1
- package/node_modules/@opentelemetry/core/dist/version.mjs.map +1 -1
- package/node_modules/@opentelemetry/core/package.json +2 -2
- package/node_modules/@opentelemetry/resources/README.md +21 -2
- package/node_modules/@opentelemetry/resources/dist/detectors/EnvDetector.cjs +9 -47
- package/node_modules/@opentelemetry/resources/dist/detectors/EnvDetector.cjs.map +1 -1
- package/node_modules/@opentelemetry/resources/dist/detectors/EnvDetector.d.cts +10 -24
- package/node_modules/@opentelemetry/resources/dist/detectors/EnvDetector.d.cts.map +1 -1
- package/node_modules/@opentelemetry/resources/dist/detectors/EnvDetector.d.mts +10 -24
- package/node_modules/@opentelemetry/resources/dist/detectors/EnvDetector.d.mts.map +1 -1
- package/node_modules/@opentelemetry/resources/dist/detectors/EnvDetector.mjs +9 -47
- package/node_modules/@opentelemetry/resources/dist/detectors/EnvDetector.mjs.map +1 -1
- package/node_modules/@opentelemetry/resources/dist/detectors/ResourceAttributesEnvDetector.cjs +70 -0
- package/node_modules/@opentelemetry/resources/dist/detectors/ResourceAttributesEnvDetector.cjs.map +1 -0
- package/node_modules/@opentelemetry/resources/dist/detectors/ResourceAttributesEnvDetector.d.cts +35 -0
- package/node_modules/@opentelemetry/resources/dist/detectors/ResourceAttributesEnvDetector.d.cts.map +1 -0
- package/node_modules/@opentelemetry/resources/dist/detectors/ResourceAttributesEnvDetector.d.mts +35 -0
- package/node_modules/@opentelemetry/resources/dist/detectors/ResourceAttributesEnvDetector.d.mts.map +1 -0
- package/node_modules/@opentelemetry/resources/dist/detectors/ResourceAttributesEnvDetector.mjs +69 -0
- package/node_modules/@opentelemetry/resources/dist/detectors/ResourceAttributesEnvDetector.mjs.map +1 -0
- package/node_modules/@opentelemetry/resources/dist/detectors/ServiceNameEnvDetector.cjs +19 -0
- package/node_modules/@opentelemetry/resources/dist/detectors/ServiceNameEnvDetector.cjs.map +1 -0
- package/node_modules/@opentelemetry/resources/dist/detectors/ServiceNameEnvDetector.d.cts +12 -0
- package/node_modules/@opentelemetry/resources/dist/detectors/ServiceNameEnvDetector.d.cts.map +1 -0
- package/node_modules/@opentelemetry/resources/dist/detectors/ServiceNameEnvDetector.d.mts +12 -0
- package/node_modules/@opentelemetry/resources/dist/detectors/ServiceNameEnvDetector.d.mts.map +1 -0
- package/node_modules/@opentelemetry/resources/dist/detectors/ServiceNameEnvDetector.mjs +19 -0
- package/node_modules/@opentelemetry/resources/dist/detectors/ServiceNameEnvDetector.mjs.map +1 -0
- package/node_modules/@opentelemetry/resources/dist/detectors/index.d.cts +3 -1
- package/node_modules/@opentelemetry/resources/dist/detectors/index.d.mts +3 -1
- package/node_modules/@opentelemetry/resources/dist/detectors/index.mjs +3 -1
- package/node_modules/@opentelemetry/resources/dist/detectors/platform/node/ServiceInstanceIdDetector.cjs +0 -3
- package/node_modules/@opentelemetry/resources/dist/detectors/platform/node/ServiceInstanceIdDetector.cjs.map +1 -1
- package/node_modules/@opentelemetry/resources/dist/detectors/platform/node/ServiceInstanceIdDetector.d.cts +0 -3
- package/node_modules/@opentelemetry/resources/dist/detectors/platform/node/ServiceInstanceIdDetector.d.cts.map +1 -1
- package/node_modules/@opentelemetry/resources/dist/detectors/platform/node/ServiceInstanceIdDetector.d.mts +0 -3
- package/node_modules/@opentelemetry/resources/dist/detectors/platform/node/ServiceInstanceIdDetector.d.mts.map +1 -1
- package/node_modules/@opentelemetry/resources/dist/detectors/platform/node/ServiceInstanceIdDetector.mjs +0 -3
- package/node_modules/@opentelemetry/resources/dist/detectors/platform/node/ServiceInstanceIdDetector.mjs.map +1 -1
- package/node_modules/@opentelemetry/resources/dist/index.cjs +4 -0
- package/node_modules/@opentelemetry/resources/dist/index.d.cts +3 -1
- package/node_modules/@opentelemetry/resources/dist/index.d.mts +3 -1
- package/node_modules/@opentelemetry/resources/dist/index.mjs +3 -1
- package/node_modules/@opentelemetry/resources/package.json +3 -3
- package/node_modules/@salesforce/plugin-trust/README.md +14 -30
- package/node_modules/@salesforce/plugin-trust/oclif.manifest.json +1 -1
- package/node_modules/@salesforce/plugin-trust/package.json +4 -4
- package/node_modules/npm/docs/content/commands/npm-ls.md +1 -1
- package/node_modules/npm/docs/content/commands/npm.md +1 -1
- package/node_modules/npm/docs/output/commands/npm-access.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-adduser.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-approve-scripts.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-audit.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-bugs.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-cache.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-ci.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-completion.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-config.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-dedupe.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-deny-scripts.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-deprecate.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-diff.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-dist-tag.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-docs.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-doctor.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-edit.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-exec.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-explain.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-explore.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-find-dupes.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-fund.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-get.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-help-search.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-help.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-init.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-install-ci-test.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-install-scripts.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-install-test.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-install.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-link.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-ll.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-login.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-logout.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-ls.html +3 -3
- package/node_modules/npm/docs/output/commands/npm-org.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-outdated.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-owner.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-pack.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-ping.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-pkg.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-prefix.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-profile.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-prune.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-publish.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-query.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-rebuild.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-repo.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-restart.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-root.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-run.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-sbom.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-search.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-set.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-shrinkwrap.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-stage.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-star.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-stars.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-start.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-stop.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-team.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-test.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-token.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-trust.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-undeprecate.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-uninstall.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-unpublish.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-unstar.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-update.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-version.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-view.html +2 -2
- package/node_modules/npm/docs/output/commands/npm-whoami.html +2 -2
- package/node_modules/npm/docs/output/commands/npm.html +3 -3
- package/node_modules/npm/docs/output/commands/npx.html +2 -2
- package/node_modules/npm/docs/output/configuring-npm/folders.html +2 -2
- package/node_modules/npm/docs/output/configuring-npm/install.html +2 -2
- package/node_modules/npm/docs/output/configuring-npm/npm-global.html +2 -2
- package/node_modules/npm/docs/output/configuring-npm/npm-json.html +2 -2
- package/node_modules/npm/docs/output/configuring-npm/npm-shrinkwrap-json.html +2 -2
- package/node_modules/npm/docs/output/configuring-npm/npmrc.html +2 -2
- package/node_modules/npm/docs/output/configuring-npm/package-json.html +2 -2
- package/node_modules/npm/docs/output/configuring-npm/package-lock-json.html +2 -2
- package/node_modules/npm/docs/output/using-npm/config.html +2 -2
- package/node_modules/npm/docs/output/using-npm/dependency-selectors.html +2 -2
- package/node_modules/npm/docs/output/using-npm/developers.html +2 -2
- package/node_modules/npm/docs/output/using-npm/logging.html +2 -2
- package/node_modules/npm/docs/output/using-npm/orgs.html +2 -2
- package/node_modules/npm/docs/output/using-npm/package-spec.html +2 -2
- package/node_modules/npm/docs/output/using-npm/registry.html +2 -2
- package/node_modules/npm/docs/output/using-npm/removal.html +2 -2
- package/node_modules/npm/docs/output/using-npm/scope.html +2 -2
- package/node_modules/npm/docs/output/using-npm/scripts.html +2 -2
- package/node_modules/npm/docs/output/using-npm/workspaces.html +2 -2
- package/node_modules/npm/lib/cli/entry.js +1 -1
- package/node_modules/npm/man/man1/npm-access.1 +1 -1
- package/node_modules/npm/man/man1/npm-adduser.1 +1 -1
- package/node_modules/npm/man/man1/npm-approve-scripts.1 +1 -1
- package/node_modules/npm/man/man1/npm-audit.1 +1 -1
- package/node_modules/npm/man/man1/npm-bugs.1 +1 -1
- package/node_modules/npm/man/man1/npm-cache.1 +1 -1
- package/node_modules/npm/man/man1/npm-ci.1 +1 -1
- package/node_modules/npm/man/man1/npm-completion.1 +1 -1
- package/node_modules/npm/man/man1/npm-config.1 +1 -1
- package/node_modules/npm/man/man1/npm-dedupe.1 +1 -1
- package/node_modules/npm/man/man1/npm-deny-scripts.1 +1 -1
- package/node_modules/npm/man/man1/npm-deprecate.1 +1 -1
- package/node_modules/npm/man/man1/npm-diff.1 +1 -1
- package/node_modules/npm/man/man1/npm-dist-tag.1 +1 -1
- package/node_modules/npm/man/man1/npm-docs.1 +1 -1
- package/node_modules/npm/man/man1/npm-doctor.1 +1 -1
- package/node_modules/npm/man/man1/npm-edit.1 +1 -1
- package/node_modules/npm/man/man1/npm-exec.1 +1 -1
- package/node_modules/npm/man/man1/npm-explain.1 +1 -1
- package/node_modules/npm/man/man1/npm-explore.1 +1 -1
- package/node_modules/npm/man/man1/npm-find-dupes.1 +1 -1
- package/node_modules/npm/man/man1/npm-fund.1 +1 -1
- package/node_modules/npm/man/man1/npm-get.1 +1 -1
- package/node_modules/npm/man/man1/npm-help-search.1 +1 -1
- package/node_modules/npm/man/man1/npm-help.1 +1 -1
- package/node_modules/npm/man/man1/npm-init.1 +1 -1
- package/node_modules/npm/man/man1/npm-install-ci-test.1 +1 -1
- package/node_modules/npm/man/man1/npm-install-scripts.1 +1 -1
- package/node_modules/npm/man/man1/npm-install-test.1 +1 -1
- package/node_modules/npm/man/man1/npm-install.1 +1 -1
- package/node_modules/npm/man/man1/npm-link.1 +1 -1
- package/node_modules/npm/man/man1/npm-ll.1 +1 -1
- package/node_modules/npm/man/man1/npm-login.1 +1 -1
- package/node_modules/npm/man/man1/npm-logout.1 +1 -1
- package/node_modules/npm/man/man1/npm-ls.1 +2 -2
- package/node_modules/npm/man/man1/npm-org.1 +1 -1
- package/node_modules/npm/man/man1/npm-outdated.1 +1 -1
- package/node_modules/npm/man/man1/npm-owner.1 +1 -1
- package/node_modules/npm/man/man1/npm-pack.1 +1 -1
- package/node_modules/npm/man/man1/npm-ping.1 +1 -1
- package/node_modules/npm/man/man1/npm-pkg.1 +1 -1
- package/node_modules/npm/man/man1/npm-prefix.1 +1 -1
- package/node_modules/npm/man/man1/npm-profile.1 +1 -1
- package/node_modules/npm/man/man1/npm-prune.1 +1 -1
- package/node_modules/npm/man/man1/npm-publish.1 +1 -1
- package/node_modules/npm/man/man1/npm-query.1 +1 -1
- package/node_modules/npm/man/man1/npm-rebuild.1 +1 -1
- package/node_modules/npm/man/man1/npm-repo.1 +1 -1
- package/node_modules/npm/man/man1/npm-restart.1 +1 -1
- package/node_modules/npm/man/man1/npm-root.1 +1 -1
- package/node_modules/npm/man/man1/npm-run.1 +1 -1
- package/node_modules/npm/man/man1/npm-sbom.1 +1 -1
- package/node_modules/npm/man/man1/npm-search.1 +1 -1
- package/node_modules/npm/man/man1/npm-set.1 +1 -1
- package/node_modules/npm/man/man1/npm-shrinkwrap.1 +1 -1
- package/node_modules/npm/man/man1/npm-stage.1 +1 -1
- package/node_modules/npm/man/man1/npm-star.1 +1 -1
- package/node_modules/npm/man/man1/npm-stars.1 +1 -1
- package/node_modules/npm/man/man1/npm-start.1 +1 -1
- package/node_modules/npm/man/man1/npm-stop.1 +1 -1
- package/node_modules/npm/man/man1/npm-team.1 +1 -1
- package/node_modules/npm/man/man1/npm-test.1 +1 -1
- package/node_modules/npm/man/man1/npm-token.1 +1 -1
- package/node_modules/npm/man/man1/npm-trust.1 +1 -1
- package/node_modules/npm/man/man1/npm-undeprecate.1 +1 -1
- package/node_modules/npm/man/man1/npm-uninstall.1 +1 -1
- package/node_modules/npm/man/man1/npm-unpublish.1 +1 -1
- package/node_modules/npm/man/man1/npm-unstar.1 +1 -1
- package/node_modules/npm/man/man1/npm-update.1 +1 -1
- package/node_modules/npm/man/man1/npm-version.1 +1 -1
- package/node_modules/npm/man/man1/npm-view.1 +1 -1
- package/node_modules/npm/man/man1/npm-whoami.1 +1 -1
- package/node_modules/npm/man/man1/npm.1 +2 -2
- package/node_modules/npm/man/man1/npx.1 +1 -1
- package/node_modules/npm/man/man5/folders.5 +1 -1
- package/node_modules/npm/man/man5/install.5 +1 -1
- package/node_modules/npm/man/man5/npm-global.5 +1 -1
- package/node_modules/npm/man/man5/npm-json.5 +1 -1
- package/node_modules/npm/man/man5/npm-shrinkwrap-json.5 +1 -1
- package/node_modules/npm/man/man5/npmrc.5 +1 -1
- package/node_modules/npm/man/man5/package-json.5 +1 -1
- package/node_modules/npm/man/man5/package-lock-json.5 +1 -1
- package/node_modules/npm/man/man7/config.7 +1 -1
- package/node_modules/npm/man/man7/dependency-selectors.7 +1 -1
- package/node_modules/npm/man/man7/developers.7 +1 -1
- package/node_modules/npm/man/man7/logging.7 +1 -1
- package/node_modules/npm/man/man7/orgs.7 +1 -1
- package/node_modules/npm/man/man7/package-spec.7 +1 -1
- package/node_modules/npm/man/man7/registry.7 +1 -1
- package/node_modules/npm/man/man7/removal.7 +1 -1
- package/node_modules/npm/man/man7/scope.7 +1 -1
- package/node_modules/npm/man/man7/scripts.7 +1 -1
- package/node_modules/npm/man/man7/workspaces.7 +1 -1
- package/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js +9 -2
- package/node_modules/npm/node_modules/@npmcli/promise-spawn/package.json +3 -2
- package/node_modules/npm/node_modules/bin-links/lib/get-paths.js +2 -0
- package/node_modules/npm/node_modules/bin-links/package.json +2 -1
- package/node_modules/npm/node_modules/ip-address/dist/common.js +2 -2
- package/node_modules/npm/node_modules/ip-address/dist/ipv4.js +7 -0
- package/node_modules/npm/node_modules/ip-address/dist/ipv6.js +7 -4
- package/node_modules/npm/node_modules/ip-address/dist/v6/constants.js +3 -0
- package/node_modules/npm/node_modules/ip-address/package.json +3 -2
- package/node_modules/npm/node_modules/libnpmexec/README.md +9 -1
- package/node_modules/npm/node_modules/libnpmexec/lib/index.js +6 -2
- package/node_modules/npm/node_modules/libnpmexec/lib/run-script.js +22 -5
- package/node_modules/npm/node_modules/libnpmexec/package.json +1 -1
- package/node_modules/npm/node_modules/pacote/lib/registry.js +71 -2
- package/node_modules/npm/node_modules/pacote/package.json +3 -2
- package/node_modules/npm/node_modules/semver/classes/range.js +2 -2
- package/node_modules/npm/node_modules/semver/internal/constants.js +30 -0
- package/node_modules/npm/node_modules/semver/internal/trim-comparator-whitespace.js +438 -0
- package/node_modules/npm/node_modules/semver/package.json +1 -1
- package/node_modules/npm/node_modules/undici/docs/docs/api/Client.md +2 -0
- package/node_modules/npm/node_modules/undici/lib/dispatcher/agent.js +6 -2
- package/node_modules/npm/node_modules/undici/lib/dispatcher/client-h1.js +0 -2
- package/node_modules/npm/node_modules/undici/lib/dispatcher/client-h2.js +0 -4
- package/node_modules/npm/node_modules/undici/lib/dispatcher/client.js +3 -2
- package/node_modules/npm/node_modules/undici/lib/dispatcher/dispatcher-base.js +9 -0
- package/node_modules/npm/node_modules/undici/lib/web/eventsource/eventsource-stream.js +91 -10
- package/node_modules/npm/node_modules/undici/lib/web/eventsource/eventsource.js +4 -1
- package/node_modules/npm/node_modules/undici/lib/web/fetch/index.js +7 -9
- package/node_modules/npm/node_modules/undici/lib/web/websocket/receiver.js +14 -0
- package/node_modules/npm/node_modules/undici/package.json +1 -1
- package/node_modules/npm/package.json +5 -5
- package/node_modules/semver/classes/range.js +2 -2
- package/node_modules/semver/internal/constants.js +30 -0
- package/node_modules/semver/internal/trim-comparator-whitespace.js +438 -0
- package/node_modules/semver/package.json +1 -1
- package/oclif.manifest.json +1 -1
- package/package.json +5 -5
- package/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__pycache__/MSVSUtil.cpython-314.pyc +0 -0
- package/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__pycache__/MSVSVersion.cpython-314.pyc +0 -0
- package/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__pycache__/__init__.cpython-314.pyc +0 -0
- package/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__pycache__/common.cpython-314.pyc +0 -0
- package/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__pycache__/input.cpython-314.pyc +0 -0
- package/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__pycache__/msvs_emulation.cpython-314.pyc +0 -0
- package/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__pycache__/ninja_syntax.cpython-314.pyc +0 -0
- package/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__pycache__/simple_copy.cpython-314.pyc +0 -0
- package/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__pycache__/xcode_emulation.cpython-314.pyc +0 -0
- package/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__pycache__/xcode_ninja.cpython-314.pyc +0 -0
- package/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__pycache__/xcodeproj_file.cpython-314.pyc +0 -0
- package/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/__pycache__/__init__.cpython-314.pyc +0 -0
- package/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/__pycache__/make.cpython-314.pyc +0 -0
- package/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/__pycache__/ninja.cpython-314.pyc +0 -0
- package/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/__pycache__/xcode.cpython-314.pyc +0 -0
- package/node_modules/npm/node_modules/node-gyp/gyp/pylib/packaging/__pycache__/__init__.cpython-314.pyc +0 -0
- package/node_modules/npm/node_modules/node-gyp/gyp/pylib/packaging/__pycache__/_structures.cpython-314.pyc +0 -0
- package/node_modules/npm/node_modules/node-gyp/gyp/pylib/packaging/__pycache__/version.cpython-314.pyc +0 -0
|
@@ -3,7 +3,10 @@ const runScript = require('@npmcli/run-script')
|
|
|
3
3
|
const pkgJson = require('@npmcli/package-json')
|
|
4
4
|
const { log, output } = require('proc-log')
|
|
5
5
|
const noTTY = require('./no-tty.js')
|
|
6
|
-
const
|
|
6
|
+
const isWindows = require('./is-windows.js')
|
|
7
|
+
|
|
8
|
+
const isCmd = shell => /(?:^|[\\/])cmd(?:\.exe)?$/i.test(shell)
|
|
9
|
+
const isPowerShell = shell => /(?:^|[\\/])(?:powershell|pwsh)(?:\.exe)?$/i.test(shell)
|
|
7
10
|
|
|
8
11
|
const run = async ({
|
|
9
12
|
args,
|
|
@@ -15,10 +18,24 @@ const run = async ({
|
|
|
15
18
|
runPath,
|
|
16
19
|
scriptShell,
|
|
17
20
|
}) => {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
if (!call && args.length > 0) {
|
|
22
|
+
const shell = scriptShell || (isWindows ? process.env.ComSpec || 'cmd' : 'sh')
|
|
23
|
+
if (isCmd(shell)) {
|
|
24
|
+
// Variable expansion (including delayed expansion) and embedded quotes
|
|
25
|
+
// cannot be safely escaped here. Control characters are invalid filenames.
|
|
26
|
+
if (/["%!]/.test(args[0]) || [...args[0]].some(c => c.charCodeAt(0) < 32)) {
|
|
27
|
+
throw Object.assign(
|
|
28
|
+
new Error(`Invalid executable name for cmd.exe: ${JSON.stringify(args[0])}`),
|
|
29
|
+
{ code: 'EINVALIDCOMMAND' }
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
// Protect both cmd.exe's metacharacter parsing and executable-name parsing.
|
|
33
|
+
args[0] = `"${args[0]}"`.replace(/[ ^&()<>|";,*?=@]/g, '^$&')
|
|
34
|
+
} else if (isPowerShell(shell)) {
|
|
35
|
+
// Encode the whole invocation to avoid promise-spawn's POSIX argument escaping.
|
|
36
|
+
const quotedArgs = args.map(arg => `'${arg.replace(/['\u2018-\u201b]/g, '$&$&')}'`)
|
|
37
|
+
args = [`& ${quotedArgs.join(' ')}`]
|
|
38
|
+
} else {
|
|
22
39
|
// single-quote so shell metacharacters in the executable name are taken
|
|
23
40
|
// literally; double quotes still expand $(), backticks, $var and "
|
|
24
41
|
args[0] = `'${args[0].replace(/'/g, `'\\''`)}'`
|
|
@@ -113,6 +113,70 @@ class RegistryFetcher extends Fetcher {
|
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
+
// Registry signatures and attestations authenticate `name@version`, so the
|
|
117
|
+
// manifest must claim the requested name and be listed under its own
|
|
118
|
+
// version. Otherwise a registry could replay validly signed metadata from
|
|
119
|
+
// another package (or another version) and have it verify as this one.
|
|
120
|
+
#verifyManifestIdentity (packument, picked) {
|
|
121
|
+
const pickedId = `${picked.name}@${picked.version}`
|
|
122
|
+
if (picked.name !== this.spec.name) {
|
|
123
|
+
const message = [
|
|
124
|
+
`${this.spec.name} registry manifest has mismatched package name:`,
|
|
125
|
+
`expected ${this.spec.name} but got ${pickedId}`,
|
|
126
|
+
].join(' ')
|
|
127
|
+
throw Object.assign(new Error(message), {
|
|
128
|
+
code: 'EMANIFESTMISMATCH',
|
|
129
|
+
expected: this.spec.name,
|
|
130
|
+
found: pickedId,
|
|
131
|
+
})
|
|
132
|
+
}
|
|
133
|
+
if (picked._id && picked._id !== pickedId) {
|
|
134
|
+
const message = [
|
|
135
|
+
`${pickedId} registry manifest has mismatched id:`,
|
|
136
|
+
`expected ${pickedId} but got ${picked._id}`,
|
|
137
|
+
].join(' ')
|
|
138
|
+
throw Object.assign(new Error(message), {
|
|
139
|
+
code: 'EMANIFESTMISMATCH',
|
|
140
|
+
expected: pickedId,
|
|
141
|
+
found: picked._id,
|
|
142
|
+
})
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// without dist there are no signatures or attestations to authenticate
|
|
146
|
+
if (!picked.dist) {
|
|
147
|
+
return
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// npm-pick-manifest may return a shallow copy, so match on the dist object
|
|
151
|
+
const matchesPickedManifest = manifest => manifest.dist === picked.dist
|
|
152
|
+
const versionCollections = [
|
|
153
|
+
packument.versions,
|
|
154
|
+
packument.stagedVersions?.versions,
|
|
155
|
+
packument.policyRestrictions?.versions,
|
|
156
|
+
]
|
|
157
|
+
const matchingVersionKeys = []
|
|
158
|
+
for (const manifestsByVersion of versionCollections) {
|
|
159
|
+
for (const versionKey in manifestsByVersion) {
|
|
160
|
+
if (Object.hasOwn(manifestsByVersion, versionKey) &&
|
|
161
|
+
matchesPickedManifest(manifestsByVersion[versionKey])) {
|
|
162
|
+
matchingVersionKeys.push(versionKey)
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
if (matchingVersionKeys.some(versionKey => versionKey !== picked.version)) {
|
|
168
|
+
const message = [
|
|
169
|
+
`${pickedId} registry manifest has mismatched version:`,
|
|
170
|
+
`listed in the packument as ${matchingVersionKeys.join(', ')}`,
|
|
171
|
+
].join(' ')
|
|
172
|
+
throw Object.assign(new Error(message), {
|
|
173
|
+
code: 'EMANIFESTMISMATCH',
|
|
174
|
+
expected: matchingVersionKeys,
|
|
175
|
+
found: pickedId,
|
|
176
|
+
})
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
116
180
|
async manifest () {
|
|
117
181
|
if (this.package) {
|
|
118
182
|
return this.package
|
|
@@ -127,11 +191,16 @@ class RegistryFetcher extends Fetcher {
|
|
|
127
191
|
|
|
128
192
|
const packument = await this.packument()
|
|
129
193
|
const steps = PackageJson.normalizeSteps.filter(s => s !== '_attributes')
|
|
130
|
-
const
|
|
194
|
+
const picked = pickManifest(packument, this.spec.fetchSpec, {
|
|
131
195
|
...this.opts,
|
|
132
196
|
defaultTag: this.defaultTag,
|
|
133
197
|
before: this.before,
|
|
134
|
-
})
|
|
198
|
+
})
|
|
199
|
+
if (this.opts.verifySignatures || this.opts.verifyAttestations) {
|
|
200
|
+
this.#verifyManifestIdentity(packument, picked)
|
|
201
|
+
}
|
|
202
|
+
const mani = await new PackageJson().fromContent(picked)
|
|
203
|
+
.normalize({ steps }).then(p => p.content)
|
|
135
204
|
|
|
136
205
|
/* XXX add ETARGET and E403 revalidation of cached packuments here */
|
|
137
206
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pacote",
|
|
3
|
-
"version": "21.5.
|
|
3
|
+
"version": "21.5.2",
|
|
4
4
|
"description": "JavaScript package downloader",
|
|
5
5
|
"author": "GitHub Inc.",
|
|
6
6
|
"bin": {
|
|
@@ -75,6 +75,7 @@
|
|
|
75
75
|
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
|
|
76
76
|
"version": "5.1.0",
|
|
77
77
|
"windowsCI": false,
|
|
78
|
-
"publish": "true"
|
|
78
|
+
"publish": "true",
|
|
79
|
+
"backport": 21
|
|
79
80
|
}
|
|
80
81
|
}
|
|
@@ -119,7 +119,7 @@ class Range {
|
|
|
119
119
|
debug('hyphen replace', range)
|
|
120
120
|
|
|
121
121
|
// `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
|
|
122
|
-
range = range
|
|
122
|
+
range = trimComparatorWhitespace(range)
|
|
123
123
|
debug('comparator trim', range)
|
|
124
124
|
|
|
125
125
|
// `~ 1.2.3` => `~1.2.3`
|
|
@@ -224,11 +224,11 @@ const parseOptions = require('../internal/parse-options')
|
|
|
224
224
|
const Comparator = require('./comparator')
|
|
225
225
|
const debug = require('../internal/debug')
|
|
226
226
|
const SemVer = require('./semver')
|
|
227
|
+
const trimComparatorWhitespace = require('../internal/trim-comparator-whitespace')
|
|
227
228
|
const {
|
|
228
229
|
safeRe: re,
|
|
229
230
|
src,
|
|
230
231
|
t,
|
|
231
|
-
comparatorTrimReplace,
|
|
232
232
|
tildeTrimReplace,
|
|
233
233
|
caretTrimReplace,
|
|
234
234
|
} = require('../internal/re')
|
|
@@ -15,6 +15,35 @@ const MAX_SAFE_COMPONENT_LENGTH = 16
|
|
|
15
15
|
// the shortest version with a build 0.0.0+BUILD.
|
|
16
16
|
const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6
|
|
17
17
|
|
|
18
|
+
// ECMAScript whitespace and line terminators matched by \s.
|
|
19
|
+
const WHITESPACE_CHARACTERS = [
|
|
20
|
+
'\t',
|
|
21
|
+
'\n',
|
|
22
|
+
'\v',
|
|
23
|
+
'\f',
|
|
24
|
+
'\r',
|
|
25
|
+
' ',
|
|
26
|
+
'\u00a0',
|
|
27
|
+
'\u1680',
|
|
28
|
+
'\u2000',
|
|
29
|
+
'\u2001',
|
|
30
|
+
'\u2002',
|
|
31
|
+
'\u2003',
|
|
32
|
+
'\u2004',
|
|
33
|
+
'\u2005',
|
|
34
|
+
'\u2006',
|
|
35
|
+
'\u2007',
|
|
36
|
+
'\u2008',
|
|
37
|
+
'\u2009',
|
|
38
|
+
'\u200a',
|
|
39
|
+
'\u2028',
|
|
40
|
+
'\u2029',
|
|
41
|
+
'\u202f',
|
|
42
|
+
'\u205f',
|
|
43
|
+
'\u3000',
|
|
44
|
+
'\ufeff',
|
|
45
|
+
]
|
|
46
|
+
|
|
18
47
|
const RELEASE_TYPES = [
|
|
19
48
|
'major',
|
|
20
49
|
'premajor',
|
|
@@ -30,6 +59,7 @@ module.exports = {
|
|
|
30
59
|
MAX_SAFE_COMPONENT_LENGTH,
|
|
31
60
|
MAX_SAFE_BUILD_LENGTH,
|
|
32
61
|
MAX_SAFE_INTEGER,
|
|
62
|
+
WHITESPACE_CHARACTERS,
|
|
33
63
|
RELEASE_TYPES,
|
|
34
64
|
SEMVER_SPEC_VERSION,
|
|
35
65
|
FLAG_INCLUDE_PRERELEASE: 0b001,
|
|
@@ -0,0 +1,438 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
'use strict'
|
|
3
|
+
|
|
4
|
+
// Reproduce safeRe[COMPARATORTRIM] replacement boundaries, not version
|
|
5
|
+
// validation. Each end-index finder returns an exclusive end, or its start
|
|
6
|
+
// on no match.
|
|
7
|
+
// Positions count from zero. An end of 3 means characters 0, 1, and 2 were read;
|
|
8
|
+
// range.slice(start, end) gives the matched text, not a converted number.
|
|
9
|
+
const {
|
|
10
|
+
MAX_LENGTH,
|
|
11
|
+
MAX_SAFE_BUILD_LENGTH,
|
|
12
|
+
WHITESPACE_CHARACTERS,
|
|
13
|
+
} = require('./constants')
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Remembers the last two rows of digits so their characters need not be reread.
|
|
17
|
+
* Positions start at -1 until a row has been found.
|
|
18
|
+
*
|
|
19
|
+
* @typedef {object} DigitRunCache
|
|
20
|
+
* @property {number} start The first character of the most recently found row.
|
|
21
|
+
* @property {number} end The position after that row's last character.
|
|
22
|
+
* @property {number} previousStart The first character of the previous row.
|
|
23
|
+
* @property {number} previousEnd The position after the previous row.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
// One entry per UTF-16 code unit keeps membership checks constant-time.
|
|
27
|
+
const whitespace = new Uint8Array(0x10000)
|
|
28
|
+
for (const char of WHITESPACE_CHARACTERS) {
|
|
29
|
+
whitespace[char.charCodeAt(0)] = 1
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Checks whether a character is whitespace, like a space, tab, or newline.
|
|
34
|
+
* Looking past the end of the string returns false.
|
|
35
|
+
*
|
|
36
|
+
* @param {string|undefined} char One character, or undefined past the string's end.
|
|
37
|
+
* @returns {boolean} Whether the character is whitespace.
|
|
38
|
+
* @example isWhitespace(' ') // true
|
|
39
|
+
* @example isWhitespace('1') // false
|
|
40
|
+
*/
|
|
41
|
+
const isWhitespace = char =>
|
|
42
|
+
char !== undefined && whitespace[char.charCodeAt(0)] === 1
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Checks for v, =, or whitespace before the version number.
|
|
46
|
+
* These are historical version prefixes, not range operators:
|
|
47
|
+
* < and > are handled separately, as are tilde and caret ranges.
|
|
48
|
+
*
|
|
49
|
+
* @param {string|undefined} char One character to check.
|
|
50
|
+
* @returns {boolean} Whether the character can belong to a version prefix.
|
|
51
|
+
* @example isVersionPrefix('=') // true
|
|
52
|
+
* @example isVersionPrefix('>') // false
|
|
53
|
+
*/
|
|
54
|
+
const isVersionPrefix = char =>
|
|
55
|
+
char === 'v' ||
|
|
56
|
+
char === '=' ||
|
|
57
|
+
isWhitespace(char)
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Checks whether a character is one of the digits 0 through 9.
|
|
61
|
+
*
|
|
62
|
+
* @param {string|undefined} char One character to check.
|
|
63
|
+
* @returns {boolean} Whether the character is an ASCII digit.
|
|
64
|
+
* @example isDigit('7') // true
|
|
65
|
+
* @example isDigit('.') // false
|
|
66
|
+
*/
|
|
67
|
+
const isDigit = char => char !== undefined && char >= '0' && char <= '9'
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Checks whether a character is an English letter, uppercase or lowercase.
|
|
71
|
+
*
|
|
72
|
+
* @param {string|undefined} char One character to check.
|
|
73
|
+
* @returns {boolean} Whether the character is an ASCII letter.
|
|
74
|
+
* @example isLetter('b') // true
|
|
75
|
+
* @example isLetter('7') // false
|
|
76
|
+
*/
|
|
77
|
+
const isLetter = char =>
|
|
78
|
+
char !== undefined && (
|
|
79
|
+
(char >= 'a' && char <= 'z') ||
|
|
80
|
+
(char >= 'A' && char <= 'Z')
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Checks for a letter, digit, or hyphen: the characters allowed inside
|
|
85
|
+
* prerelease and build names such as beta-1.
|
|
86
|
+
*
|
|
87
|
+
* @param {string|undefined} char One character to check.
|
|
88
|
+
* @returns {boolean} Whether the character can be part of an identifier.
|
|
89
|
+
* @example isIdentifierCharacter('-') // true
|
|
90
|
+
* @example isIdentifierCharacter('.') // false; dots separate identifiers
|
|
91
|
+
*/
|
|
92
|
+
const isIdentifierCharacter = char => isDigit(char) || isLetter(char) || char === '-'
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Checks whether a version component can begin here: with a digit or
|
|
96
|
+
* a wildcard such as x, X, or *.
|
|
97
|
+
*
|
|
98
|
+
* @param {string|undefined} char One character to check.
|
|
99
|
+
* @returns {boolean} Whether a number or wildcard can start with this character.
|
|
100
|
+
* @example isVersionStart('x') // true
|
|
101
|
+
* @example isVersionStart('v') // false; v belongs to the prefix
|
|
102
|
+
*/
|
|
103
|
+
const isVersionStart = char =>
|
|
104
|
+
isDigit(char) ||
|
|
105
|
+
char === 'x' ||
|
|
106
|
+
char === 'X' ||
|
|
107
|
+
char === '*'
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Finds the end of a row of digits, but returns no more than limit digits.
|
|
111
|
+
* Remembers the last two rows so looking at them again does not reread them.
|
|
112
|
+
*
|
|
113
|
+
* @param {string} range The text to read; it is not changed.
|
|
114
|
+
* @param {number} start The position of the first character to check.
|
|
115
|
+
* @param {number} limit The most digit characters the returned match can include.
|
|
116
|
+
* @param {DigitRunCache} digitRuns Shared cache of digit-run positions, updated in place.
|
|
117
|
+
* @returns {number} The position after the matched digits, or start if none match.
|
|
118
|
+
* @example findDigitsEndIndex('123abc', 0, 10, digitRuns) // 3, pointing at a
|
|
119
|
+
* @example findDigitsEndIndex('123abc', 0, 2, digitRuns) // 2, pointing at the unread 3
|
|
120
|
+
*/
|
|
121
|
+
const findDigitsEndIndex = (range, start, limit, digitRuns) => {
|
|
122
|
+
if (!isDigit(range[start])) {
|
|
123
|
+
return start
|
|
124
|
+
}
|
|
125
|
+
if (start >= digitRuns.start && start < digitRuns.end) {
|
|
126
|
+
return Math.min(start + limit, digitRuns.end)
|
|
127
|
+
}
|
|
128
|
+
if (start >= digitRuns.previousStart && start < digitRuns.previousEnd) {
|
|
129
|
+
return Math.min(start + limit, digitRuns.previousEnd)
|
|
130
|
+
}
|
|
131
|
+
let end = start + 1
|
|
132
|
+
while (isDigit(range[end])) {
|
|
133
|
+
end++
|
|
134
|
+
}
|
|
135
|
+
// A failed full version can rewind from its second run to its first.
|
|
136
|
+
digitRuns.previousStart = digitRuns.start
|
|
137
|
+
digitRuns.previousEnd = digitRuns.end
|
|
138
|
+
digitRuns.start = start
|
|
139
|
+
digitRuns.end = end
|
|
140
|
+
return Math.min(start + limit, end)
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Reads a number using the old regex's length and leading-zero rules.
|
|
145
|
+
* Strict mode reads just the first zero in 012; loose mode can read all three.
|
|
146
|
+
*
|
|
147
|
+
* @param {string} range The text to read; it is not changed.
|
|
148
|
+
* @param {number} start The position where the number should begin.
|
|
149
|
+
* @param {boolean} loose Whether to allow leading zeros.
|
|
150
|
+
* @param {DigitRunCache} digitRuns Shared digit-run cache, updated as needed.
|
|
151
|
+
* @returns {number} The position after the matched digits, not their numeric value.
|
|
152
|
+
* @example findVersionNumberEndIndex('012', 0, false, digitRuns) // 1
|
|
153
|
+
* @example findVersionNumberEndIndex('012', 0, true, digitRuns) // 3
|
|
154
|
+
*/
|
|
155
|
+
const findVersionNumberEndIndex = (range, start, loose, digitRuns) => {
|
|
156
|
+
if (!loose && range[start] === '0') {
|
|
157
|
+
return start + 1
|
|
158
|
+
}
|
|
159
|
+
// Strict syntax allows an initial nonzero digit plus MAX_LENGTH digits.
|
|
160
|
+
return findDigitsEndIndex(range, start, loose ? MAX_LENGTH : MAX_LENGTH + 1, digitRuns)
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Reads one piece of a prerelease name, such as beta or 1 in beta.1.
|
|
165
|
+
* Tries the letter-or-hyphen form first, then the number-only form.
|
|
166
|
+
*
|
|
167
|
+
* @param {string} range The text to read; it is not changed.
|
|
168
|
+
* @param {number} start The position where the identifier should begin.
|
|
169
|
+
* @param {boolean} loose Whether numeric identifiers may have leading zeros.
|
|
170
|
+
* @param {DigitRunCache} digitRuns Shared digit-run cache, updated as needed.
|
|
171
|
+
* @returns {number} The position after the identifier, or start if none matches.
|
|
172
|
+
* @example findPrereleaseIdentifierEndIndex('beta.1', 0, false, digitRuns) // 4, at the dot
|
|
173
|
+
* @example findPrereleaseIdentifierEndIndex('001beta', 0, false, digitRuns) // 7
|
|
174
|
+
*/
|
|
175
|
+
const findPrereleaseIdentifierEndIndex = (range, start, loose, digitRuns) => {
|
|
176
|
+
const digitsEnd = findDigitsEndIndex(range, start, MAX_LENGTH, digitRuns)
|
|
177
|
+
// The legacy regex tries a nonnumeric identifier before a numeric one.
|
|
178
|
+
if (isLetter(range[digitsEnd]) || range[digitsEnd] === '-') {
|
|
179
|
+
let end = digitsEnd + 1
|
|
180
|
+
const limit = end + MAX_SAFE_BUILD_LENGTH
|
|
181
|
+
while (end < limit && isIdentifierCharacter(range[end])) {
|
|
182
|
+
end++
|
|
183
|
+
}
|
|
184
|
+
return end
|
|
185
|
+
}
|
|
186
|
+
return findVersionNumberEndIndex(range, start, loose, digitRuns)
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Reads a prerelease suffix such as -beta.1, one dot-separated piece at a time.
|
|
191
|
+
* Loose mode also allows the name without its opening hyphen.
|
|
192
|
+
*
|
|
193
|
+
* @param {string} range The text to read; it is not changed.
|
|
194
|
+
* @param {number} start The position where the suffix should begin, including -.
|
|
195
|
+
* @param {boolean} loose Whether the opening hyphen is optional and zeros allowed.
|
|
196
|
+
* @param {DigitRunCache} digitRuns Shared digit-run cache, updated as needed.
|
|
197
|
+
* @returns {number} The position after the matched suffix, or start if absent.
|
|
198
|
+
* @example findPrereleaseEndIndex('-beta.1+sha', 0, false, digitRuns) // 7, at the plus
|
|
199
|
+
* @example findPrereleaseEndIndex('beta', 0, false, digitRuns) // 0; no opening hyphen
|
|
200
|
+
*/
|
|
201
|
+
const findPrereleaseEndIndex = (range, start, loose, digitRuns) => {
|
|
202
|
+
const hyphen = range[start] === '-'
|
|
203
|
+
if (!loose && !hyphen) {
|
|
204
|
+
return start
|
|
205
|
+
}
|
|
206
|
+
const identifierStart = start + (hyphen ? 1 : 0)
|
|
207
|
+
let end = findPrereleaseIdentifierEndIndex(range, identifierStart, loose, digitRuns)
|
|
208
|
+
if (end === identifierStart) {
|
|
209
|
+
if (!loose || !hyphen) {
|
|
210
|
+
return start
|
|
211
|
+
}
|
|
212
|
+
// In loose syntax, a lone hyphen can itself be the identifier.
|
|
213
|
+
end = findPrereleaseIdentifierEndIndex(range, start, loose, digitRuns)
|
|
214
|
+
}
|
|
215
|
+
while (range[end] === '.') {
|
|
216
|
+
const next = findPrereleaseIdentifierEndIndex(range, end + 1, loose, digitRuns)
|
|
217
|
+
if (next === end + 1) {
|
|
218
|
+
break
|
|
219
|
+
}
|
|
220
|
+
end = next
|
|
221
|
+
}
|
|
222
|
+
return end
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Reads one build-name piece, such as sha or 123 in +sha.123.
|
|
227
|
+
* Stops at a disallowed character or the old regex's length limit.
|
|
228
|
+
*
|
|
229
|
+
* @param {string} range The text to read; it is not changed.
|
|
230
|
+
* @param {number} start The position where the identifier should begin.
|
|
231
|
+
* @returns {number} The position after the identifier, or start if none matches.
|
|
232
|
+
* @example findBuildIdentifierEndIndex('sha.123', 0) // 3, at the dot
|
|
233
|
+
* @example findBuildIdentifierEndIndex('001', 0) // 3; leading zeros are allowed
|
|
234
|
+
*/
|
|
235
|
+
const findBuildIdentifierEndIndex = (range, start) => {
|
|
236
|
+
let end = start
|
|
237
|
+
while (end - start < MAX_SAFE_BUILD_LENGTH && isIdentifierCharacter(range[end])) {
|
|
238
|
+
end++
|
|
239
|
+
}
|
|
240
|
+
return end
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Reads optional build metadata such as +sha.123.
|
|
245
|
+
* Leaves the position unchanged if there is no plus sign followed by a name.
|
|
246
|
+
*
|
|
247
|
+
* @param {string} range The text to read; it is not changed.
|
|
248
|
+
* @param {number} start The position where the opening + should be.
|
|
249
|
+
* @returns {number} The position after the matched metadata, or start if absent.
|
|
250
|
+
* @example findBuildEndIndex('+sha.123 <2', 0) // 8, at the space
|
|
251
|
+
* @example findBuildEndIndex('+', 0) // 0; a plus sign alone is not a match
|
|
252
|
+
*/
|
|
253
|
+
const findBuildEndIndex = (range, start) => {
|
|
254
|
+
if (range[start] !== '+') {
|
|
255
|
+
return start
|
|
256
|
+
}
|
|
257
|
+
let end = findBuildIdentifierEndIndex(range, start + 1)
|
|
258
|
+
if (end === start + 1) {
|
|
259
|
+
return start
|
|
260
|
+
}
|
|
261
|
+
while (range[end] === '.') {
|
|
262
|
+
const next = findBuildIdentifierEndIndex(range, end + 1)
|
|
263
|
+
if (next === end + 1) {
|
|
264
|
+
break
|
|
265
|
+
}
|
|
266
|
+
end = next
|
|
267
|
+
}
|
|
268
|
+
return end
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* Reads three numbers separated by dots, then any prerelease and build suffixes.
|
|
273
|
+
* Uses loose rules, so forms such as 01.02.03beta can match here.
|
|
274
|
+
*
|
|
275
|
+
* @param {string} range The text to read; it is not changed.
|
|
276
|
+
* @param {number} start The position of the first number, after any prefix.
|
|
277
|
+
* @param {DigitRunCache} digitRuns Shared digit-run cache, updated as needed.
|
|
278
|
+
* @returns {number} The position after the version match, or start if none matches.
|
|
279
|
+
* @example findLooseFullVersionEndIndex('1.2.3-beta+sha <2', 0, digitRuns) // 14
|
|
280
|
+
* @example findLooseFullVersionEndIndex('1.2', 0, digitRuns) // 0; needs three numbers
|
|
281
|
+
*/
|
|
282
|
+
const findLooseFullVersionEndIndex = (range, start, digitRuns) => {
|
|
283
|
+
let end = start
|
|
284
|
+
for (let component = 0; component < 3; component++) {
|
|
285
|
+
const next = findVersionNumberEndIndex(range, end, true, digitRuns)
|
|
286
|
+
if (next === end) {
|
|
287
|
+
return start
|
|
288
|
+
}
|
|
289
|
+
end = next
|
|
290
|
+
if (component < 2) {
|
|
291
|
+
if (range[end] !== '.') {
|
|
292
|
+
return start
|
|
293
|
+
}
|
|
294
|
+
end++
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
const prereleaseEnd = findPrereleaseEndIndex(range, end, true, digitRuns)
|
|
298
|
+
return findBuildEndIndex(range, prereleaseEnd)
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* Reads one component of a partial or wildcard version, such as 2 or x in 2.x.
|
|
303
|
+
* Numbers use strict leading-zero rules; wildcards take up one character.
|
|
304
|
+
*
|
|
305
|
+
* @param {string} range The text to read; it is not changed.
|
|
306
|
+
* @param {number} start The position where the component should begin.
|
|
307
|
+
* @param {DigitRunCache} digitRuns Shared digit-run cache, updated as needed.
|
|
308
|
+
* @returns {number} The position after the component, or start if none matches.
|
|
309
|
+
* @example findPartialVersionComponentEndIndex('2.x', 0, digitRuns) // 1, at the dot
|
|
310
|
+
* @example findPartialVersionComponentEndIndex('2.x', 2, digitRuns) // 3, after x
|
|
311
|
+
*/
|
|
312
|
+
const findPartialVersionComponentEndIndex = (range, start, digitRuns) => {
|
|
313
|
+
if (isDigit(range[start])) {
|
|
314
|
+
return findVersionNumberEndIndex(range, start, false, digitRuns)
|
|
315
|
+
}
|
|
316
|
+
return isVersionStart(range[start]) ? start + 1 : start
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* Reads up to three components, allowing forms such as 1, 1.2, or 1.x.
|
|
321
|
+
* After the third component, also reads any strict prerelease and build suffixes.
|
|
322
|
+
*
|
|
323
|
+
* @param {string} range The text to read; it is not changed.
|
|
324
|
+
* @param {number} start The position of a number or wildcard, after any prefix.
|
|
325
|
+
* @param {DigitRunCache} digitRuns Shared digit-run cache, updated as needed.
|
|
326
|
+
* @returns {number} The position after the matched version text.
|
|
327
|
+
* @example findPartialVersionEndIndex('1.x <2', 0, digitRuns) // 3, at the space
|
|
328
|
+
* @example findPartialVersionEndIndex('1.', 0, digitRuns) // 1; the trailing dot is unread
|
|
329
|
+
*/
|
|
330
|
+
const findPartialVersionEndIndex = (range, start, digitRuns) => {
|
|
331
|
+
let end = findPartialVersionComponentEndIndex(range, start, digitRuns)
|
|
332
|
+
for (let component = 0; component < 2; component++) {
|
|
333
|
+
if (range[end] !== '.') {
|
|
334
|
+
return end
|
|
335
|
+
}
|
|
336
|
+
const next = findPartialVersionComponentEndIndex(range, end + 1, digitRuns)
|
|
337
|
+
if (next === end + 1) {
|
|
338
|
+
return end
|
|
339
|
+
}
|
|
340
|
+
end = next
|
|
341
|
+
}
|
|
342
|
+
const prereleaseEnd = findPrereleaseEndIndex(range, end, false, digitRuns)
|
|
343
|
+
return findBuildEndIndex(range, prereleaseEnd)
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Finds where a version match ends, without deciding whether the range is valid.
|
|
348
|
+
* Tries a loose full version first, then a partial or wildcard version, just
|
|
349
|
+
* like the old regex's LOOSEPLAIN and XRANGEPLAIN alternatives.
|
|
350
|
+
*
|
|
351
|
+
* @param {string} range The text to read; it is not changed.
|
|
352
|
+
* @param {number} start The position of a number or wildcard, after any prefix.
|
|
353
|
+
* @param {DigitRunCache} digitRuns Shared digit-run cache, updated as needed.
|
|
354
|
+
* @returns {number} The position where scanning the next candidate can resume.
|
|
355
|
+
* @example findVersionEndIndex('1.2.3 <2', 0, digitRuns) // 5, at the space
|
|
356
|
+
* @example findVersionEndIndex('1.x <2', 0, digitRuns) // 3, at the space
|
|
357
|
+
*/
|
|
358
|
+
const findVersionEndIndex = (range, start, digitRuns) => {
|
|
359
|
+
const fullVersionEnd = findLooseFullVersionEndIndex(range, start, digitRuns)
|
|
360
|
+
return fullVersionEnd !== start
|
|
361
|
+
? fullVersionEnd
|
|
362
|
+
: findPartialVersionEndIndex(range, start, digitRuns)
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* Finds the one whitespace character the old replacement would remove.
|
|
367
|
+
* Keeps leading whitespace, skips an optional operator, and checks immediately
|
|
368
|
+
* after it. Returns -1 if there is nothing to remove.
|
|
369
|
+
*
|
|
370
|
+
* @param {string} range The text containing a candidate already found by the caller.
|
|
371
|
+
* @param {number} matchStart The candidate's position, including leading whitespace.
|
|
372
|
+
* @returns {number} The position of the removable whitespace, or -1 if absent.
|
|
373
|
+
* @example findRemovableWhitespaceIndex(' > 1', 0) // 2; keep the space at position 0
|
|
374
|
+
* @example findRemovableWhitespaceIndex('>1', 0) // -1
|
|
375
|
+
*/
|
|
376
|
+
const findRemovableWhitespaceIndex = (range, matchStart) => {
|
|
377
|
+
let position = matchStart
|
|
378
|
+
if (isWhitespace(range[position])) {
|
|
379
|
+
position++
|
|
380
|
+
}
|
|
381
|
+
if (range[position] === '<' || range[position] === '>') {
|
|
382
|
+
position++
|
|
383
|
+
}
|
|
384
|
+
if (range[position] === '=') {
|
|
385
|
+
position++
|
|
386
|
+
}
|
|
387
|
+
return isWhitespace(range[position]) ? position : -1
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* Joins an operator to its version, turning > 1.2.3 into >1.2.3.
|
|
392
|
+
* Copies everything else according to the old regex's matching rules.
|
|
393
|
+
* Moves forward through prefixes and whole versions to avoid repeatedly
|
|
394
|
+
* searching the same characters on long inputs.
|
|
395
|
+
*
|
|
396
|
+
* @param {string} range The range text to process; the original string is unchanged.
|
|
397
|
+
* @returns {string} The range with matched operator whitespace removed.
|
|
398
|
+
* @example trimComparatorWhitespace('> 1.2.3 < 2') // '>1.2.3 <2'
|
|
399
|
+
* @example trimComparatorWhitespace('> invalid') // '> invalid'
|
|
400
|
+
*/
|
|
401
|
+
const trimComparatorWhitespace = range => {
|
|
402
|
+
let result = ''
|
|
403
|
+
let copyFrom = 0
|
|
404
|
+
let cursor = 0
|
|
405
|
+
const digitRuns = { start: -1, end: -1, previousStart: -1, previousEnd: -1 }
|
|
406
|
+
|
|
407
|
+
while (cursor < range.length) {
|
|
408
|
+
const matchStart = cursor
|
|
409
|
+
if (range[cursor] === '<' || range[cursor] === '>') {
|
|
410
|
+
cursor++
|
|
411
|
+
} else if (!isVersionPrefix(range[cursor]) && !isVersionStart(range[cursor])) {
|
|
412
|
+
cursor++
|
|
413
|
+
continue
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
// Consume a v/=/whitespace run once, even when no version follows it.
|
|
417
|
+
while (cursor < range.length && isVersionPrefix(range[cursor])) {
|
|
418
|
+
cursor++
|
|
419
|
+
}
|
|
420
|
+
if (!isVersionStart(range[cursor])) {
|
|
421
|
+
continue
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
const whitespacePosition = findRemovableWhitespaceIndex(range, matchStart)
|
|
425
|
+
if (whitespacePosition !== -1) {
|
|
426
|
+
result += range.slice(copyFrom, whitespacePosition)
|
|
427
|
+
copyFrom = whitespacePosition + 1
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
// Skip the entire match, so a prerelease's trailing v cannot be
|
|
431
|
+
// reconsidered as the prefix of another version.
|
|
432
|
+
cursor = findVersionEndIndex(range, cursor, digitRuns)
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
return result + range.slice(copyFrom)
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
module.exports = trimComparatorWhitespace
|
|
@@ -29,6 +29,8 @@ Returns: `Client`
|
|
|
29
29
|
* **webSocket** `WebSocketOptions` (optional) - WebSocket-specific configuration options.
|
|
30
30
|
* **maxFragments** `number` (optional) - Default: `131072` - Maximum number of fragments in a message. Set to 0 to disable the limit.
|
|
31
31
|
* **maxPayloadSize** `number` (optional) - Default: `134217728` (128 MB) - Maximum allowed payload size in bytes for WebSocket messages. Applied to uncompressed messages, compressed frame payloads, and decompressed (permessage-deflate) messages. Set to 0 to disable the limit.
|
|
32
|
+
* **eventSource** `EventSourceOptions` (optional) - EventSource-specific configuration options.
|
|
33
|
+
* **maxEventSize** `number` (optional) - The maximum total bytes of data and metadata field values retained for a pending EventSource event. Each unfinished line is separately limited to this value plus seven syntax bytes. The number of `data:` lines per event and input chunks buffered for an unfinished line are each limited to `min(131072, max(1024, floor(maxEventSize / 128)))` to bound object overhead. Set to `0` to disable these limits. Default: `buffer.kStringMaxLength`.
|
|
32
34
|
* **pipelining** `number | null` (optional) - Default: `1` - The amount of concurrent requests to be sent over the single TCP/TLS connection according to [RFC7230](https://tools.ietf.org/html/rfc7230#section-6.3.2). Carefully consider your workload and environment before enabling concurrent requests as pipelining may reduce performance if used incorrectly. Pipelining is sensitive to network stack settings as well as head of line blocking caused by e.g. long running requests. Set to `0` to disable keep-alive connections.
|
|
33
35
|
* **connect** `ConnectOptions | Function | null` (optional) - Default: `null`.
|
|
34
36
|
* **strictContentLength** `Boolean` (optional) - Default: `true` - Whether to treat request content length mismatches as errors. If true, an error is thrown when the request content-length header doesn't match the length of the request body.
|