@zuplo/cli 6.69.4 → 6.69.5
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/dist/__tests__/integration/jest-mocks-setup.js +29 -10
- package/dist/__tests__/integration/jest-mocks-setup.js.map +1 -1
- package/dist/cmds/custom-domain/index.d.ts.map +1 -1
- package/dist/cmds/custom-domain/index.js +6 -10
- package/dist/cmds/custom-domain/index.js.map +1 -1
- package/dist/cmds/mtls-certificates/index.d.ts.map +1 -1
- package/dist/cmds/mtls-certificates/index.js +8 -12
- package/dist/cmds/mtls-certificates/index.js.map +1 -1
- package/dist/cmds/open-api/index.d.ts.map +1 -1
- package/dist/cmds/open-api/index.js +2 -5
- package/dist/cmds/open-api/index.js.map +1 -1
- package/dist/cmds/project/index.d.ts.map +1 -1
- package/dist/cmds/project/index.js +2 -5
- package/dist/cmds/project/index.js.map +1 -1
- package/dist/cmds/proxies/index.d.ts +4 -4
- package/dist/cmds/proxies/index.d.ts.map +1 -1
- package/dist/cmds/proxies/index.js +6 -10
- package/dist/cmds/proxies/index.js.map +1 -1
- package/dist/cmds/source/index.d.ts.map +1 -1
- package/dist/cmds/source/index.js +2 -9
- package/dist/cmds/source/index.js.map +1 -1
- package/dist/cmds/source/migrate.d.ts +4 -4
- package/dist/cmds/source/migrate.d.ts.map +1 -1
- package/dist/cmds/source/migrate.js +3 -6
- package/dist/cmds/source/migrate.js.map +1 -1
- package/dist/cmds/tunnel/index.d.ts.map +1 -1
- package/dist/cmds/tunnel/index.js +8 -12
- package/dist/cmds/tunnel/index.js.map +1 -1
- package/dist/cmds/tunnel/services/index.d.ts.map +1 -1
- package/dist/cmds/tunnel/services/index.js +2 -5
- package/dist/cmds/tunnel/services/index.js.map +1 -1
- package/dist/cmds/variable/index.d.ts.map +1 -1
- package/dist/cmds/variable/index.js +2 -5
- package/dist/cmds/variable/index.js.map +1 -1
- package/dist/common/handler.d.ts +4 -1
- package/dist/common/handler.d.ts.map +1 -1
- package/dist/common/handler.js +11 -2
- package/dist/common/handler.js.map +1 -1
- package/dist/common/middleware/get-environment-param.d.ts.map +1 -1
- package/dist/common/middleware/get-environment-param.js +2 -18
- package/dist/common/middleware/get-environment-param.js.map +1 -1
- package/dist/common/utils/build-environment-prompt-choices.d.ts +13 -0
- package/dist/common/utils/build-environment-prompt-choices.d.ts.map +1 -0
- package/dist/common/utils/build-environment-prompt-choices.js +66 -0
- package/dist/common/utils/build-environment-prompt-choices.js.map +1 -0
- package/dist/common/utils/build-environment-prompt-choices.test.d.ts +2 -0
- package/dist/common/utils/build-environment-prompt-choices.test.d.ts.map +1 -0
- package/dist/common/utils/build-environment-prompt-choices.test.js +97 -0
- package/dist/common/utils/build-environment-prompt-choices.test.js.map +1 -0
- package/dist/common/utils/pretty-print-environment-prompt.d.ts +1 -4
- package/dist/common/utils/pretty-print-environment-prompt.d.ts.map +1 -1
- package/dist/common/utils/pretty-print-environment-prompt.js +3 -8
- package/dist/common/utils/pretty-print-environment-prompt.js.map +1 -1
- package/dist/common/utils/pretty-print-environment-prompt.test.js +15 -17
- package/dist/common/utils/pretty-print-environment-prompt.test.js.map +1 -1
- package/dist/common/utils/sort-environments-for-prompt.d.ts +5 -0
- package/dist/common/utils/sort-environments-for-prompt.d.ts.map +1 -0
- package/dist/common/utils/sort-environments-for-prompt.js +27 -0
- package/dist/common/utils/sort-environments-for-prompt.js.map +1 -0
- package/dist/common/utils/sort-environments-for-prompt.test.d.ts +2 -0
- package/dist/common/utils/sort-environments-for-prompt.test.d.ts.map +1 -0
- package/dist/common/utils/sort-environments-for-prompt.test.js +82 -0
- package/dist/common/utils/sort-environments-for-prompt.test.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@fastify/proxy-addr/node_modules/ipaddr.js/README.md +1 -5
- package/node_modules/@fastify/proxy-addr/node_modules/ipaddr.js/ipaddr.min.js +1 -1
- package/node_modules/@fastify/proxy-addr/node_modules/ipaddr.js/lib/ipaddr.js +21 -6
- package/node_modules/@fastify/proxy-addr/node_modules/ipaddr.js/package.json +1 -1
- package/node_modules/@zuplo/core/index.minified.js +141 -137
- package/node_modules/@zuplo/core/package.json +1 -1
- package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/.github/workflows/ci.yml +1 -1
- package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/.github/workflows/lock-threads.yml +19 -0
- package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/LICENSE +1 -3
- package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/benchmark/bench-cmp-lib.js +60 -44
- package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/index.js +2 -2
- package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/package.json +7 -7
- package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/test/anyof.test.js +20 -0
- package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/test/array.test.js +22 -0
- package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/test/debug-mode.test.js +21 -0
- package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/test/if-then-else.test.js +72 -0
- package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/test/invalidSchema.test.js +20 -0
- package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/test/issue-836.test.js +183 -0
- package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/test/json-add-comma.test.js +57 -57
- package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/test/oneof.test.js +20 -0
- package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/test/ref.test.js +31 -0
- package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/test/typebox.test.js +1 -1
- package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/types/{index.test-d.ts → index.tst.ts} +17 -17
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel-browser.d.ts.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel-browser.js.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel.d.ts +5 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel.js +7 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/index.d.ts +1380 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/index.d.ts.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/index.js +1686 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/index.js.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/index.min.js +2 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/index.min.js.map +7 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/perf.d.ts +12 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/perf.d.ts.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/perf.js +11 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/perf.js.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/diagnostics-channel-cjs.cjs.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/diagnostics-channel-cjs.d.cts.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/diagnostics-channel.d.ts +2 -2
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/diagnostics-channel.js +4 -7
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/index.d.ts +2 -3
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/index.d.ts.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/index.js +10 -16
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/index.js.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/index.min.js +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/index.min.js.map +4 -4
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel-node.d.ts.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel-node.js.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel.d.ts +5 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel.js +9 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/index.d.ts +1380 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/index.d.ts.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/index.js +1686 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/index.js.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/index.min.js +2 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/index.min.js.map +7 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/perf.d.ts +12 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/perf.d.ts.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/perf.js +11 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/perf.js.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/perf.d.ts +12 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/perf.d.ts.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/perf.js +11 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/perf.js.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.d.ts.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.js.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/diagnostics-channel.d.ts +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/diagnostics-channel.js +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/index.d.ts +2 -3
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/index.d.ts.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/index.js +9 -15
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/index.js.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/index.min.js +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/index.min.js.map +4 -4
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/perf.d.ts +12 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/perf.d.ts.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/perf.js +8 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/perf.js.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/diagnostics-channel-esm.d.mts.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/diagnostics-channel-esm.mjs.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/index.d.ts +2 -3
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/index.d.ts.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/index.js +9 -15
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/index.js.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/index.min.js +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/index.min.js.map +4 -4
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.d.ts.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.js.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/diagnostics-channel.d.ts +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/diagnostics-channel.js +2 -3
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/index.d.ts +2 -3
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/index.d.ts.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/index.js +9 -15
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/index.js.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/index.min.js +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/index.min.js.map +4 -4
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/perf.d.ts +12 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/perf.d.ts.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/perf.js +8 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/perf.js.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/perf.d.ts +12 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/perf.d.ts.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/perf.js +8 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/perf.js.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/package.json +44 -16
- package/node_modules/@zuplo/graphql/package.json +1 -1
- package/node_modules/@zuplo/openapi-tools/package.json +1 -1
- package/node_modules/@zuplo/otel/package.json +1 -1
- package/node_modules/@zuplo/runtime/out/esm/index.js +54 -54
- package/node_modules/@zuplo/runtime/out/esm/index.js.map +1 -1
- package/node_modules/@zuplo/runtime/out/types/index.d.ts +4 -0
- package/node_modules/@zuplo/runtime/package.json +1 -1
- package/node_modules/axios/CHANGELOG.md +32 -6
- package/node_modules/axios/README.md +356 -20
- package/node_modules/axios/dist/axios.js +1389 -1071
- package/node_modules/axios/dist/axios.js.map +1 -1
- package/node_modules/axios/dist/axios.min.js +3 -3
- package/node_modules/axios/dist/axios.min.js.map +1 -1
- package/node_modules/axios/dist/browser/axios.cjs +1486 -1123
- package/node_modules/axios/dist/browser/axios.cjs.map +1 -1
- package/node_modules/axios/dist/esm/axios.js +1488 -1124
- package/node_modules/axios/dist/esm/axios.js.map +1 -1
- package/node_modules/axios/dist/esm/axios.min.js +2 -2
- package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
- package/node_modules/axios/dist/node/axios.cjs +1230 -871
- package/node_modules/axios/dist/node/axios.cjs.map +1 -1
- package/node_modules/axios/index.d.cts +25 -13
- package/node_modules/axios/index.d.ts +21 -4
- package/node_modules/axios/index.js +2 -0
- package/node_modules/axios/lib/adapters/adapters.js +4 -2
- package/node_modules/axios/lib/adapters/fetch.js +126 -10
- package/node_modules/axios/lib/adapters/http.js +178 -59
- package/node_modules/axios/lib/adapters/xhr.js +6 -2
- package/node_modules/axios/lib/core/Axios.js +7 -3
- package/node_modules/axios/lib/core/AxiosError.js +86 -1
- package/node_modules/axios/lib/core/AxiosHeaders.js +3 -0
- package/node_modules/axios/lib/core/dispatchRequest.js +19 -7
- package/node_modules/axios/lib/core/mergeConfig.js +6 -3
- package/node_modules/axios/lib/core/settle.js +7 -11
- package/node_modules/axios/lib/defaults/index.js +1 -1
- package/node_modules/axios/lib/env/data.js +1 -1
- package/node_modules/axios/lib/helpers/buildURL.js +1 -1
- package/node_modules/axios/lib/helpers/cookies.js +14 -2
- package/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js +28 -1
- package/node_modules/axios/lib/helpers/formDataToStream.js +1 -1
- package/node_modules/axios/lib/helpers/parseProtocol.js +1 -1
- package/node_modules/axios/lib/helpers/resolveConfig.js +33 -17
- package/node_modules/axios/lib/helpers/shouldBypassProxy.js +26 -1
- package/node_modules/axios/lib/helpers/validator.js +1 -1
- package/node_modules/axios/lib/utils.js +27 -15
- package/node_modules/axios/package.json +17 -24
- package/node_modules/fast-uri/.github/workflows/ci.yml +12 -7
- package/node_modules/fast-uri/.github/workflows/lock-threads.yml +19 -0
- package/node_modules/fast-uri/.github/workflows/package-manager-ci.yml +1 -1
- package/node_modules/fast-uri/LICENSE +1 -3
- package/node_modules/fast-uri/README.md +13 -4
- package/node_modules/fast-uri/index.js +90 -24
- package/node_modules/fast-uri/lib/utils.js +129 -22
- package/node_modules/fast-uri/package.json +3 -4
- package/node_modules/fast-uri/test/equal.test.js +9 -0
- package/node_modules/fast-uri/test/parse.test.js +5 -0
- package/node_modules/fast-uri/test/resolve.test.js +9 -0
- package/node_modules/fast-uri/test/security-normalization.test.js +39 -0
- package/node_modules/fast-uri/test/security.test.js +133 -0
- package/node_modules/is-core-module/CHANGELOG.md +244 -113
- package/node_modules/is-core-module/README.md +1 -1
- package/node_modules/is-core-module/core.json +12 -12
- package/node_modules/is-core-module/package.json +5 -5
- package/node_modules/is-core-module/test/index.js +101 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel-browser.d.ts.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel-browser.js.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel.d.ts +5 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel.js +7 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/index.d.ts +1380 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/index.d.ts.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/index.js +1686 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/index.js.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/index.min.js +2 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/index.min.js.map +7 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/perf.d.ts +12 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/perf.d.ts.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/perf.js +11 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/perf.js.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/diagnostics-channel-cjs.cjs.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/diagnostics-channel-cjs.d.cts.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/diagnostics-channel.d.ts +2 -2
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/diagnostics-channel.js +4 -7
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/index.d.ts +2 -3
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/index.d.ts.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/index.js +10 -16
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/index.js.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/index.min.js +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/index.min.js.map +4 -4
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel-node.d.ts.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel-node.js.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel.d.ts +5 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel.js +9 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/index.d.ts +1380 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/index.d.ts.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/index.js +1686 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/index.js.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/index.min.js +2 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/index.min.js.map +7 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/perf.d.ts +12 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/perf.d.ts.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/perf.js +11 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/perf.js.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/perf.d.ts +12 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/perf.d.ts.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/perf.js +11 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/perf.js.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.d.ts.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.js.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/diagnostics-channel.d.ts +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/diagnostics-channel.js +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/index.d.ts +2 -3
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/index.d.ts.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/index.js +9 -15
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/index.js.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/index.min.js +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/index.min.js.map +4 -4
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/perf.d.ts +12 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/perf.d.ts.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/perf.js +8 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/perf.js.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/diagnostics-channel-esm.d.mts.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/diagnostics-channel-esm.mjs.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/index.d.ts +2 -3
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/index.d.ts.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/index.js +9 -15
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/index.js.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/index.min.js +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/index.min.js.map +4 -4
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.d.ts.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.js.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/diagnostics-channel.d.ts +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/diagnostics-channel.js +2 -3
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/index.d.ts +2 -3
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/index.d.ts.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/index.js +9 -15
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/index.js.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/index.min.js +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/index.min.js.map +4 -4
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/perf.d.ts +12 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/perf.d.ts.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/perf.js +8 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/perf.js.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/perf.d.ts +12 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/perf.d.ts.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/perf.js +8 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/perf.js.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/package.json +44 -16
- package/package.json +6 -6
- package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/.github/stale.yml +0 -21
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/diagnostics-channel.d.ts.map +0 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/diagnostics-channel.js.map +0 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.d.mts.map +0 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.mjs.map +0 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.d.mts.map +0 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.mjs.map +0 -1
- package/node_modules/fast-uri/.github/.stale.yml +0 -21
- package/node_modules/fast-uri/.github/tests_checker.yml +0 -8
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/diagnostics-channel.d.ts.map +0 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/diagnostics-channel.js.map +0 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.d.mts.map +0 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.mjs.map +0 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.d.mts.map +0 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.mjs.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
const { normalizeIPv6, removeDotSegments, recomposeAuthority,
|
|
3
|
+
const { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, escapePreservingEscapes, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require('./lib/utils')
|
|
4
4
|
const { SCHEMES, getSchemeHandler } = require('./lib/schemes')
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -11,7 +11,7 @@ const { SCHEMES, getSchemeHandler } = require('./lib/schemes')
|
|
|
11
11
|
*/
|
|
12
12
|
function normalize (uri, options) {
|
|
13
13
|
if (typeof uri === 'string') {
|
|
14
|
-
uri = /** @type {T} */ (
|
|
14
|
+
uri = /** @type {T} */ (normalizeString(uri, options))
|
|
15
15
|
} else if (typeof uri === 'object') {
|
|
16
16
|
uri = /** @type {T} */ (parse(serialize(uri, options), options))
|
|
17
17
|
}
|
|
@@ -106,21 +106,10 @@ function resolveComponent (base, relative, options, skipNormalization) {
|
|
|
106
106
|
* @returns {boolean}
|
|
107
107
|
*/
|
|
108
108
|
function equal (uriA, uriB, options) {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
uriA = serialize(normalizeComponentEncoding(parse(uriA, options), true), { ...options, skipEscape: true })
|
|
112
|
-
} else if (typeof uriA === 'object') {
|
|
113
|
-
uriA = serialize(normalizeComponentEncoding(uriA, true), { ...options, skipEscape: true })
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
if (typeof uriB === 'string') {
|
|
117
|
-
uriB = unescape(uriB)
|
|
118
|
-
uriB = serialize(normalizeComponentEncoding(parse(uriB, options), true), { ...options, skipEscape: true })
|
|
119
|
-
} else if (typeof uriB === 'object') {
|
|
120
|
-
uriB = serialize(normalizeComponentEncoding(uriB, true), { ...options, skipEscape: true })
|
|
121
|
-
}
|
|
109
|
+
const normalizedA = normalizeComparableURI(uriA, options)
|
|
110
|
+
const normalizedB = normalizeComparableURI(uriB, options)
|
|
122
111
|
|
|
123
|
-
return
|
|
112
|
+
return normalizedA !== undefined && normalizedB !== undefined && normalizedA.toLowerCase() === normalizedB.toLowerCase()
|
|
124
113
|
}
|
|
125
114
|
|
|
126
115
|
/**
|
|
@@ -156,13 +145,13 @@ function serialize (cmpts, opts) {
|
|
|
156
145
|
|
|
157
146
|
if (component.path !== undefined) {
|
|
158
147
|
if (!options.skipEscape) {
|
|
159
|
-
component.path =
|
|
148
|
+
component.path = escapePreservingEscapes(component.path)
|
|
160
149
|
|
|
161
150
|
if (component.scheme !== undefined) {
|
|
162
151
|
component.path = component.path.split('%3A').join(':')
|
|
163
152
|
}
|
|
164
153
|
} else {
|
|
165
|
-
component.path =
|
|
154
|
+
component.path = normalizePercentEncoding(component.path)
|
|
166
155
|
}
|
|
167
156
|
}
|
|
168
157
|
|
|
@@ -213,12 +202,29 @@ function serialize (cmpts, opts) {
|
|
|
213
202
|
|
|
214
203
|
const URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u
|
|
215
204
|
|
|
205
|
+
/**
|
|
206
|
+
* @param {import('./types/index').URIComponent} parsed
|
|
207
|
+
* @param {RegExpMatchArray} matches
|
|
208
|
+
* @returns {string|undefined}
|
|
209
|
+
*/
|
|
210
|
+
function getParseError (parsed, matches) {
|
|
211
|
+
if (matches[2] !== undefined && parsed.path && parsed.path[0] !== '/') {
|
|
212
|
+
return 'URI path must start with "/" when authority is present.'
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
if (typeof parsed.port === 'number' && (parsed.port < 0 || parsed.port > 65535)) {
|
|
216
|
+
return 'URI port is malformed.'
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
return undefined
|
|
220
|
+
}
|
|
221
|
+
|
|
216
222
|
/**
|
|
217
223
|
* @param {string} uri
|
|
218
224
|
* @param {import('./types/index').Options} [opts]
|
|
219
|
-
* @returns
|
|
225
|
+
* @returns {{ parsed: import('./types/index').URIComponent, malformedAuthorityOrPort: boolean }}
|
|
220
226
|
*/
|
|
221
|
-
function
|
|
227
|
+
function parseWithStatus (uri, opts) {
|
|
222
228
|
const options = Object.assign({}, opts)
|
|
223
229
|
/** @type {import('./types/index').URIComponent} */
|
|
224
230
|
const parsed = {
|
|
@@ -231,6 +237,8 @@ function parse (uri, opts) {
|
|
|
231
237
|
fragment: undefined
|
|
232
238
|
}
|
|
233
239
|
|
|
240
|
+
let malformedAuthorityOrPort = false
|
|
241
|
+
|
|
234
242
|
let isIP = false
|
|
235
243
|
if (options.reference === 'suffix') {
|
|
236
244
|
if (options.scheme) {
|
|
@@ -256,6 +264,13 @@ function parse (uri, opts) {
|
|
|
256
264
|
if (isNaN(parsed.port)) {
|
|
257
265
|
parsed.port = matches[5]
|
|
258
266
|
}
|
|
267
|
+
|
|
268
|
+
const parseError = getParseError(parsed, matches)
|
|
269
|
+
if (parseError !== undefined) {
|
|
270
|
+
parsed.error = parsed.error || parseError
|
|
271
|
+
malformedAuthorityOrPort = true
|
|
272
|
+
}
|
|
273
|
+
|
|
259
274
|
if (parsed.host) {
|
|
260
275
|
const ipv4result = isIPv4(parsed.host)
|
|
261
276
|
if (ipv4result === false) {
|
|
@@ -304,14 +319,18 @@ function parse (uri, opts) {
|
|
|
304
319
|
parsed.scheme = unescape(parsed.scheme)
|
|
305
320
|
}
|
|
306
321
|
if (parsed.host !== undefined) {
|
|
307
|
-
parsed.host = unescape(parsed.host)
|
|
322
|
+
parsed.host = reescapeHostDelimiters(unescape(parsed.host), isIP)
|
|
308
323
|
}
|
|
309
324
|
}
|
|
310
325
|
if (parsed.path) {
|
|
311
|
-
parsed.path =
|
|
326
|
+
parsed.path = normalizePathEncoding(parsed.path)
|
|
312
327
|
}
|
|
313
328
|
if (parsed.fragment) {
|
|
314
|
-
|
|
329
|
+
try {
|
|
330
|
+
parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment))
|
|
331
|
+
} catch {
|
|
332
|
+
parsed.error = parsed.error || 'URI malformed'
|
|
333
|
+
}
|
|
315
334
|
}
|
|
316
335
|
}
|
|
317
336
|
|
|
@@ -322,7 +341,54 @@ function parse (uri, opts) {
|
|
|
322
341
|
} else {
|
|
323
342
|
parsed.error = parsed.error || 'URI can not be parsed.'
|
|
324
343
|
}
|
|
325
|
-
return parsed
|
|
344
|
+
return { parsed, malformedAuthorityOrPort }
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* @param {string} uri
|
|
349
|
+
* @param {import('./types/index').Options} [opts]
|
|
350
|
+
* @returns
|
|
351
|
+
*/
|
|
352
|
+
function parse (uri, opts) {
|
|
353
|
+
return parseWithStatus(uri, opts).parsed
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* @param {string} uri
|
|
358
|
+
* @param {import('./types/index').Options} [opts]
|
|
359
|
+
* @returns {string}
|
|
360
|
+
*/
|
|
361
|
+
function normalizeString (uri, opts) {
|
|
362
|
+
return normalizeStringWithStatus(uri, opts).normalized
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* @param {string} uri
|
|
367
|
+
* @param {import('./types/index').Options} [opts]
|
|
368
|
+
* @returns {{ normalized: string, malformedAuthorityOrPort: boolean }}
|
|
369
|
+
*/
|
|
370
|
+
function normalizeStringWithStatus (uri, opts) {
|
|
371
|
+
const { parsed, malformedAuthorityOrPort } = parseWithStatus(uri, opts)
|
|
372
|
+
return {
|
|
373
|
+
normalized: malformedAuthorityOrPort ? uri : serialize(parsed, opts),
|
|
374
|
+
malformedAuthorityOrPort
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
/**
|
|
379
|
+
* @param {import ('./types/index').URIComponent|string} uri
|
|
380
|
+
* @param {import('./types/index').Options} [opts]
|
|
381
|
+
* @returns {string|undefined}
|
|
382
|
+
*/
|
|
383
|
+
function normalizeComparableURI (uri, opts) {
|
|
384
|
+
if (typeof uri === 'string') {
|
|
385
|
+
const { normalized, malformedAuthorityOrPort } = normalizeStringWithStatus(uri, opts)
|
|
386
|
+
return malformedAuthorityOrPort ? undefined : normalized
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
if (typeof uri === 'object') {
|
|
390
|
+
return serialize(uri, opts)
|
|
391
|
+
}
|
|
326
392
|
}
|
|
327
393
|
|
|
328
394
|
const fastUri = {
|
|
@@ -6,6 +6,15 @@ const isUUID = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\d
|
|
|
6
6
|
/** @type {(value: string) => boolean} */
|
|
7
7
|
const isIPv4 = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u)
|
|
8
8
|
|
|
9
|
+
/** @type {(value: string) => boolean} */
|
|
10
|
+
const isHexPair = RegExp.prototype.test.bind(/^[\da-f]{2}$/iu)
|
|
11
|
+
|
|
12
|
+
/** @type {(value: string) => boolean} */
|
|
13
|
+
const isUnreserved = RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu)
|
|
14
|
+
|
|
15
|
+
/** @type {(value: string) => boolean} */
|
|
16
|
+
const isPathCharacter = RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu)
|
|
17
|
+
|
|
9
18
|
/**
|
|
10
19
|
* @param {Array<string>} input
|
|
11
20
|
* @returns {string}
|
|
@@ -264,31 +273,126 @@ function removeDotSegments (path) {
|
|
|
264
273
|
}
|
|
265
274
|
|
|
266
275
|
/**
|
|
267
|
-
*
|
|
268
|
-
*
|
|
269
|
-
*
|
|
276
|
+
* Re-escape RFC 3986 gen-delims that must not appear literally in the host.
|
|
277
|
+
* After the URI regex parses, these characters cannot be literal in the host
|
|
278
|
+
* field, so any that appear after decoding came from percent-encoding and
|
|
279
|
+
* must be restored to prevent authority structure changes.
|
|
280
|
+
*
|
|
281
|
+
* @param {string} host
|
|
282
|
+
* @param {boolean} isIP - true for IPv4/IPv6 hosts (skip colon re-escaping)
|
|
283
|
+
* @returns {string}
|
|
270
284
|
*/
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
285
|
+
const HOST_DELIMS = { '@': '%40', '/': '%2F', '?': '%3F', '#': '%23', ':': '%3A' }
|
|
286
|
+
const HOST_DELIM_RE = /[@/?#:]/g
|
|
287
|
+
const HOST_DELIM_NO_COLON_RE = /[@/?#]/g
|
|
288
|
+
|
|
289
|
+
function reescapeHostDelimiters (host, isIP) {
|
|
290
|
+
const re = isIP ? HOST_DELIM_NO_COLON_RE : HOST_DELIM_RE
|
|
291
|
+
re.lastIndex = 0
|
|
292
|
+
return host.replace(re, (ch) => HOST_DELIMS[ch])
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* Normalizes percent escapes and optionally decodes only unreserved ASCII bytes.
|
|
297
|
+
* Reserved delimiters such as `%2F` and `%2E` stay escaped.
|
|
298
|
+
*
|
|
299
|
+
* @param {string} input
|
|
300
|
+
* @param {boolean} [decodeUnreserved=false]
|
|
301
|
+
* @returns {string}
|
|
302
|
+
*/
|
|
303
|
+
function normalizePercentEncoding (input, decodeUnreserved = false) {
|
|
304
|
+
if (input.indexOf('%') === -1) {
|
|
305
|
+
return input
|
|
281
306
|
}
|
|
282
|
-
|
|
283
|
-
|
|
307
|
+
|
|
308
|
+
let output = ''
|
|
309
|
+
|
|
310
|
+
for (let i = 0; i < input.length; i++) {
|
|
311
|
+
if (input[i] === '%' && i + 2 < input.length) {
|
|
312
|
+
const hex = input.slice(i + 1, i + 3)
|
|
313
|
+
if (isHexPair(hex)) {
|
|
314
|
+
const normalizedHex = hex.toUpperCase()
|
|
315
|
+
const decoded = String.fromCharCode(parseInt(normalizedHex, 16))
|
|
316
|
+
|
|
317
|
+
if (decodeUnreserved && isUnreserved(decoded)) {
|
|
318
|
+
output += decoded
|
|
319
|
+
} else {
|
|
320
|
+
output += '%' + normalizedHex
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
i += 2
|
|
324
|
+
continue
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
output += input[i]
|
|
284
329
|
}
|
|
285
|
-
|
|
286
|
-
|
|
330
|
+
|
|
331
|
+
return output
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* Normalizes path data without turning reserved escapes into live path syntax.
|
|
336
|
+
* Valid escapes are uppercased, raw unsafe characters are escaped, and only
|
|
337
|
+
* unreserved bytes that are not `.` are decoded.
|
|
338
|
+
*
|
|
339
|
+
* @param {string} input
|
|
340
|
+
* @returns {string}
|
|
341
|
+
*/
|
|
342
|
+
function normalizePathEncoding (input) {
|
|
343
|
+
let output = ''
|
|
344
|
+
|
|
345
|
+
for (let i = 0; i < input.length; i++) {
|
|
346
|
+
if (input[i] === '%' && i + 2 < input.length) {
|
|
347
|
+
const hex = input.slice(i + 1, i + 3)
|
|
348
|
+
if (isHexPair(hex)) {
|
|
349
|
+
const normalizedHex = hex.toUpperCase()
|
|
350
|
+
const decoded = String.fromCharCode(parseInt(normalizedHex, 16))
|
|
351
|
+
|
|
352
|
+
if (decoded !== '.' && isUnreserved(decoded)) {
|
|
353
|
+
output += decoded
|
|
354
|
+
} else {
|
|
355
|
+
output += '%' + normalizedHex
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
i += 2
|
|
359
|
+
continue
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
if (isPathCharacter(input[i])) {
|
|
364
|
+
output += input[i]
|
|
365
|
+
} else {
|
|
366
|
+
output += escape(input[i])
|
|
367
|
+
}
|
|
287
368
|
}
|
|
288
|
-
|
|
289
|
-
|
|
369
|
+
|
|
370
|
+
return output
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* Escapes a component while preserving existing valid percent escapes.
|
|
375
|
+
*
|
|
376
|
+
* @param {string} input
|
|
377
|
+
* @returns {string}
|
|
378
|
+
*/
|
|
379
|
+
function escapePreservingEscapes (input) {
|
|
380
|
+
let output = ''
|
|
381
|
+
|
|
382
|
+
for (let i = 0; i < input.length; i++) {
|
|
383
|
+
if (input[i] === '%' && i + 2 < input.length) {
|
|
384
|
+
const hex = input.slice(i + 1, i + 3)
|
|
385
|
+
if (isHexPair(hex)) {
|
|
386
|
+
output += '%' + hex.toUpperCase()
|
|
387
|
+
i += 2
|
|
388
|
+
continue
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
output += escape(input[i])
|
|
290
393
|
}
|
|
291
|
-
|
|
394
|
+
|
|
395
|
+
return output
|
|
292
396
|
}
|
|
293
397
|
|
|
294
398
|
/**
|
|
@@ -310,7 +414,7 @@ function recomposeAuthority (component) {
|
|
|
310
414
|
if (ipV6res.isIPV6 === true) {
|
|
311
415
|
host = `[${ipV6res.escapedHost}]`
|
|
312
416
|
} else {
|
|
313
|
-
host =
|
|
417
|
+
host = reescapeHostDelimiters(host, false)
|
|
314
418
|
}
|
|
315
419
|
}
|
|
316
420
|
uriTokens.push(host)
|
|
@@ -327,7 +431,10 @@ function recomposeAuthority (component) {
|
|
|
327
431
|
module.exports = {
|
|
328
432
|
nonSimpleDomain,
|
|
329
433
|
recomposeAuthority,
|
|
330
|
-
|
|
434
|
+
reescapeHostDelimiters,
|
|
435
|
+
normalizePercentEncoding,
|
|
436
|
+
normalizePathEncoding,
|
|
437
|
+
escapePreservingEscapes,
|
|
331
438
|
removeDotSegments,
|
|
332
439
|
isIPv4,
|
|
333
440
|
isUUID,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fast-uri",
|
|
3
3
|
"description": "Dependency-free RFC 3986 URI toolbox",
|
|
4
|
-
"version": "3.1.
|
|
4
|
+
"version": "3.1.2",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "commonjs",
|
|
7
7
|
"types": "types/index.d.ts",
|
|
@@ -58,12 +58,11 @@
|
|
|
58
58
|
"test:typescript": "tsd"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@fastify/pre-commit": "^2.1.0",
|
|
62
61
|
"ajv": "^8.16.0",
|
|
63
62
|
"eslint": "^9.17.0",
|
|
64
|
-
"neostandard": "^0.
|
|
63
|
+
"neostandard": "^0.13.0",
|
|
65
64
|
"playwright-test": "^14.1.12",
|
|
66
65
|
"tape": "^5.8.1",
|
|
67
|
-
"tsd": "^0.
|
|
66
|
+
"tsd": "^0.33.0"
|
|
68
67
|
}
|
|
69
68
|
}
|
|
@@ -106,3 +106,12 @@ test('WSS Equal', (t) => {
|
|
|
106
106
|
runTest(t, suite)
|
|
107
107
|
t.end()
|
|
108
108
|
})
|
|
109
|
+
|
|
110
|
+
test('URI Equals tolerates malformed fragments', (t) => {
|
|
111
|
+
t.equal(
|
|
112
|
+
fastURI.equal('http://example.com/#%E0%A4A', 'http://example.com/#%E0%A4A'),
|
|
113
|
+
true,
|
|
114
|
+
'malformed fragment does not throw during equality checks'
|
|
115
|
+
)
|
|
116
|
+
t.end()
|
|
117
|
+
})
|
|
@@ -150,6 +150,11 @@ test('URI parse', (t) => {
|
|
|
150
150
|
t.equal(components.query, undefined, 'query')
|
|
151
151
|
t.equal(components.fragment, '%0D', 'fragment')
|
|
152
152
|
|
|
153
|
+
// malformed percent-encoded fragment must not throw
|
|
154
|
+
components = fastURI.parse('http://example.com/#%E0%A4A')
|
|
155
|
+
t.equal(components.error, 'URI malformed', 'malformed fragment errors')
|
|
156
|
+
t.equal(components.fragment, '%E0%A4A', 'malformed fragment is preserved')
|
|
157
|
+
|
|
153
158
|
// all
|
|
154
159
|
components = fastURI.parse('uri://user:pass@example.com:123/one/two.three?q1=a1&q2=a2#body')
|
|
155
160
|
t.equal(components.error, undefined, 'all errors')
|
|
@@ -76,3 +76,12 @@ test('URN Resolving', (t) => {
|
|
|
76
76
|
t.equal(fastURI.resolve('urn:some:other:prop', 'urn:some:ip:prop'), 'urn:some:ip:prop', 'urn:some:ip:prop')
|
|
77
77
|
t.end()
|
|
78
78
|
})
|
|
79
|
+
|
|
80
|
+
test('URI Resolving tolerates malformed fragments', (t) => {
|
|
81
|
+
t.equal(
|
|
82
|
+
fastURI.resolve('http://base.com/', 'http://example.com/#%E0%A4A'),
|
|
83
|
+
'http://example.com/#%E0%A4A',
|
|
84
|
+
'malformed fragment does not throw during resolve'
|
|
85
|
+
)
|
|
86
|
+
t.end()
|
|
87
|
+
})
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const test = require('tape')
|
|
4
|
+
const fastURI = require('..')
|
|
5
|
+
|
|
6
|
+
test('parse preserves reserved path escapes as data', (t) => {
|
|
7
|
+
const components = fastURI.parse('http://example.com/a%2Fb/public/%2e%2e/admin')
|
|
8
|
+
|
|
9
|
+
t.equal(components.path, '/a%2Fb/public/%2E%2E/admin')
|
|
10
|
+
t.end()
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
test('normalize preserves percent-encoded path separators and dot segments', (t) => {
|
|
14
|
+
t.equal(
|
|
15
|
+
fastURI.normalize('http://example.com/public/%2e%2e/admin'),
|
|
16
|
+
'http://example.com/public/%2E%2E/admin'
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
t.equal(
|
|
20
|
+
fastURI.normalize('http://example.com/a%2Fb'),
|
|
21
|
+
'http://example.com/a%2Fb'
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
t.end()
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
test('equal does not treat reserved path escapes as live path syntax', (t) => {
|
|
28
|
+
t.equal(
|
|
29
|
+
fastURI.equal('http://example.com/public/%2e%2e/admin', 'http://example.com/admin', {}),
|
|
30
|
+
false
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
t.equal(
|
|
34
|
+
fastURI.equal('http://example.com/a%2Fb', 'http://example.com/a/b', {}),
|
|
35
|
+
false
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
t.end()
|
|
39
|
+
})
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const test = require('tape')
|
|
4
|
+
const fastURI = require('..')
|
|
5
|
+
|
|
6
|
+
test('parse marks malformed authority and port inputs as errors', (t) => {
|
|
7
|
+
const malformedCases = [
|
|
8
|
+
{
|
|
9
|
+
input: 'http://[::1]foo',
|
|
10
|
+
expectedError: 'URI path must start with "/" when authority is present.'
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
input: 'http://[::1]:80abc/path',
|
|
14
|
+
expectedError: 'URI path must start with "/" when authority is present.'
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
input: 'http://example.com:80abc/path',
|
|
18
|
+
expectedError: 'URI path must start with "/" when authority is present.'
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
input: 'http://[::1]:65536',
|
|
22
|
+
expectedError: 'URI port is malformed.'
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
t.plan(malformedCases.length)
|
|
27
|
+
|
|
28
|
+
malformedCases.forEach(({ input, expectedError }) => {
|
|
29
|
+
t.equal(fastURI.parse(input).error, expectedError, input)
|
|
30
|
+
})
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
test('normalize does not canonicalize malformed URLs into different valid URLs', (t) => {
|
|
34
|
+
const malformedCases = [
|
|
35
|
+
'http://[::1]foo',
|
|
36
|
+
'http://[::1]:80abc/path',
|
|
37
|
+
'http://example.com:80abc/path',
|
|
38
|
+
'http://[::1]:65536'
|
|
39
|
+
]
|
|
40
|
+
|
|
41
|
+
t.plan(malformedCases.length)
|
|
42
|
+
|
|
43
|
+
malformedCases.forEach((input) => {
|
|
44
|
+
t.equal(fastURI.normalize(input), input, input)
|
|
45
|
+
})
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
test('equal returns false when either side is malformed', (t) => {
|
|
49
|
+
const malformedPairs = [
|
|
50
|
+
['http://[::1]foo', 'http://[::1]/foo'],
|
|
51
|
+
['http://[::1]:80abc/path', 'http://[::1]/abc/path'],
|
|
52
|
+
['http://example.com:80abc/path', 'http://example.com/abc/path'],
|
|
53
|
+
['http://[::1]:65536', 'http://[::1]:65536/']
|
|
54
|
+
]
|
|
55
|
+
|
|
56
|
+
t.plan(malformedPairs.length)
|
|
57
|
+
|
|
58
|
+
malformedPairs.forEach(([left, right]) => {
|
|
59
|
+
t.equal(fastURI.equal(left, right), false, `${left} != ${right}`)
|
|
60
|
+
})
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
test('normalize preserves encoded authority delimiters in host', (t) => {
|
|
64
|
+
const cases = [
|
|
65
|
+
['http://trusted.com%40evil.com/', 'http://trusted.com%40evil.com/'],
|
|
66
|
+
['http://example.com%3A8080/', 'http://example.com%3A8080/'],
|
|
67
|
+
['http://example.com%2Fevil.com/path', 'http://example.com%2Fevil.com/path'],
|
|
68
|
+
['http://example.com%23fragment/path', 'http://example.com%23fragment/path'],
|
|
69
|
+
['http://example.com%3Fq=evil/path', 'http://example.com%3Fq=evil/path'],
|
|
70
|
+
['http://user%3Apass%40evil.com/', 'http://user%3Apass%40evil.com/'],
|
|
71
|
+
['http://user@trusted.com%40evil.com/', 'http://user@trusted.com%40evil.com/'],
|
|
72
|
+
['https://trusted.com%40evil.com/', 'https://trusted.com%40evil.com/'],
|
|
73
|
+
['ws://trusted.com%40evil.com/chat', 'ws://trusted.com%40evil.com/chat'],
|
|
74
|
+
['wss://trusted.com%40evil.com/chat', 'wss://trusted.com%40evil.com/chat']
|
|
75
|
+
]
|
|
76
|
+
|
|
77
|
+
t.plan(cases.length)
|
|
78
|
+
|
|
79
|
+
cases.forEach(([input, expected]) => {
|
|
80
|
+
t.equal(fastURI.normalize(input), expected, input)
|
|
81
|
+
})
|
|
82
|
+
})
|
|
83
|
+
|
|
84
|
+
test('parse preserves encoded authority delimiters in host', (t) => {
|
|
85
|
+
const cases = [
|
|
86
|
+
['http://trusted.com%40evil.com/', 'trusted.com%40evil.com'],
|
|
87
|
+
['http://example.com%3A8080/', 'example.com%3A8080'],
|
|
88
|
+
['http://user%3Apass%40evil.com/', 'user%3Apass%40evil.com']
|
|
89
|
+
]
|
|
90
|
+
|
|
91
|
+
t.plan(cases.length)
|
|
92
|
+
|
|
93
|
+
cases.forEach(([input, expectedHost]) => {
|
|
94
|
+
t.equal(fastURI.parse(input).host, expectedHost, input)
|
|
95
|
+
})
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
test('equal returns false when encoded delimiters differ from live delimiters', (t) => {
|
|
99
|
+
const pairs = [
|
|
100
|
+
['http://trusted.com%40evil.com/', 'http://trusted.com@evil.com/'],
|
|
101
|
+
['http://example.com%3A8080/', 'http://example.com:8080/']
|
|
102
|
+
]
|
|
103
|
+
|
|
104
|
+
t.plan(pairs.length)
|
|
105
|
+
|
|
106
|
+
pairs.forEach(([left, right]) => {
|
|
107
|
+
t.equal(fastURI.equal(left, right, {}), false, `${left} != ${right}`)
|
|
108
|
+
})
|
|
109
|
+
})
|
|
110
|
+
|
|
111
|
+
test('resolve preserves encoded authority delimiters', (t) => {
|
|
112
|
+
const result = fastURI.resolve('http://base.com/', '//trusted.com%40evil.com/path')
|
|
113
|
+
const parsed = fastURI.parse(result)
|
|
114
|
+
|
|
115
|
+
t.plan(1)
|
|
116
|
+
t.notEqual(parsed.host, 'evil.com', '//trusted.com%40evil.com/path')
|
|
117
|
+
})
|
|
118
|
+
|
|
119
|
+
test('serialize escapes authority delimiters in host field', (t) => {
|
|
120
|
+
const result = fastURI.serialize({ scheme: 'http', host: 'trusted.com@evil.com', path: '/' })
|
|
121
|
+
const parsed = fastURI.parse(result)
|
|
122
|
+
|
|
123
|
+
t.plan(1)
|
|
124
|
+
t.notEqual(parsed.host, 'evil.com', 'host: trusted.com@evil.com')
|
|
125
|
+
})
|
|
126
|
+
|
|
127
|
+
test('normalize does not double-decode %2540 into a live @', (t) => {
|
|
128
|
+
const result = fastURI.normalize('http://trusted.com%2540evil.com/')
|
|
129
|
+
const parsed = fastURI.parse(result)
|
|
130
|
+
|
|
131
|
+
t.plan(1)
|
|
132
|
+
t.notEqual(parsed.host, 'trusted.com@evil.com', 'http://trusted.com%2540evil.com/')
|
|
133
|
+
})
|