cdk-ecr-deployment 0.0.76 → 0.0.79
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/.jsii +28 -25
- package/lambda/Dockerfile +25 -0
- package/lambda/install.js +64 -0
- package/lib/index.js +40 -23
- package/node_modules/@sindresorhus/is/dist/index.d.ts +225 -0
- package/node_modules/@sindresorhus/is/dist/index.js +427 -0
- package/node_modules/@sindresorhus/is/dist/types.d.ts +24 -0
- package/node_modules/@sindresorhus/is/dist/types.js +3 -0
- package/node_modules/@sindresorhus/is/license +9 -0
- package/node_modules/@sindresorhus/is/package.json +96 -0
- package/node_modules/@sindresorhus/is/readme.md +628 -0
- package/node_modules/@szmarczak/http-timer/LICENSE +21 -0
- package/node_modules/@szmarczak/http-timer/README.md +93 -0
- package/node_modules/@szmarczak/http-timer/dist/source/index.d.ts +32 -0
- package/node_modules/@szmarczak/http-timer/dist/source/index.js +126 -0
- package/node_modules/@szmarczak/http-timer/package.json +72 -0
- package/node_modules/@types/cacheable-request/LICENSE +21 -0
- package/node_modules/@types/cacheable-request/README.md +16 -0
- package/node_modules/@types/cacheable-request/index.d.ts +137 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/LICENSE +21 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/README.md +16 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/assert/strict.d.ts +8 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/assert.d.ts +912 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/async_hooks.d.ts +497 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/buffer.d.ts +2142 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/child_process.d.ts +1365 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/cluster.d.ts +414 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/console.d.ts +412 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/constants.d.ts +18 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/crypto.d.ts +3307 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/dgram.d.ts +545 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/diagnostics_channel.d.ts +128 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/dns/promises.d.ts +357 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/dns.d.ts +643 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/domain.d.ts +169 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/events.d.ts +623 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/fs/promises.d.ts +1004 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/fs.d.ts +3748 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/globals.d.ts +284 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/globals.global.d.ts +1 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/http.d.ts +1368 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/http2.d.ts +2100 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/https.d.ts +391 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/index.d.ts +131 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/inspector.d.ts +2738 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/module.d.ts +114 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/net.d.ts +783 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/os.d.ts +455 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/package.json +230 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/path.d.ts +172 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/perf_hooks.d.ts +555 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/process.d.ts +1477 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/punycode.d.ts +117 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/querystring.d.ts +131 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/readline.d.ts +542 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/repl.d.ts +424 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/consumers.d.ts +24 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/promises.d.ts +42 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/web.d.ts +6 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/stream.d.ts +1249 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/string_decoder.d.ts +67 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/timers/promises.d.ts +68 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/timers.d.ts +94 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/tls.d.ts +1019 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/trace_events.d.ts +161 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/tty.d.ts +204 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/url.d.ts +798 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/util.d.ts +1563 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/v8.d.ts +378 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/vm.d.ts +507 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/wasi.d.ts +158 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/worker_threads.d.ts +649 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/zlib.d.ts +517 -0
- package/node_modules/@types/cacheable-request/package.json +35 -0
- package/node_modules/@types/http-cache-semantics/LICENSE +21 -0
- package/node_modules/@types/http-cache-semantics/README.md +16 -0
- package/node_modules/@types/http-cache-semantics/index.d.ts +170 -0
- package/node_modules/@types/http-cache-semantics/package.json +25 -0
- package/node_modules/@types/keyv/LICENSE +21 -0
- package/node_modules/@types/keyv/README.md +16 -0
- package/node_modules/@types/keyv/index.d.ts +77 -0
- package/node_modules/@types/keyv/node_modules/@types/node/LICENSE +21 -0
- package/node_modules/@types/keyv/node_modules/@types/node/README.md +16 -0
- package/node_modules/@types/keyv/node_modules/@types/node/assert/strict.d.ts +8 -0
- package/node_modules/@types/keyv/node_modules/@types/node/assert.d.ts +912 -0
- package/node_modules/@types/keyv/node_modules/@types/node/async_hooks.d.ts +497 -0
- package/node_modules/@types/keyv/node_modules/@types/node/buffer.d.ts +2142 -0
- package/node_modules/@types/keyv/node_modules/@types/node/child_process.d.ts +1365 -0
- package/node_modules/@types/keyv/node_modules/@types/node/cluster.d.ts +414 -0
- package/node_modules/@types/keyv/node_modules/@types/node/console.d.ts +412 -0
- package/node_modules/@types/keyv/node_modules/@types/node/constants.d.ts +18 -0
- package/node_modules/@types/keyv/node_modules/@types/node/crypto.d.ts +3307 -0
- package/node_modules/@types/keyv/node_modules/@types/node/dgram.d.ts +545 -0
- package/node_modules/@types/keyv/node_modules/@types/node/diagnostics_channel.d.ts +128 -0
- package/node_modules/@types/keyv/node_modules/@types/node/dns/promises.d.ts +357 -0
- package/node_modules/@types/keyv/node_modules/@types/node/dns.d.ts +643 -0
- package/node_modules/@types/keyv/node_modules/@types/node/domain.d.ts +169 -0
- package/node_modules/@types/keyv/node_modules/@types/node/events.d.ts +623 -0
- package/node_modules/@types/keyv/node_modules/@types/node/fs/promises.d.ts +1004 -0
- package/node_modules/@types/keyv/node_modules/@types/node/fs.d.ts +3748 -0
- package/node_modules/@types/keyv/node_modules/@types/node/globals.d.ts +284 -0
- package/node_modules/@types/keyv/node_modules/@types/node/globals.global.d.ts +1 -0
- package/node_modules/@types/keyv/node_modules/@types/node/http.d.ts +1368 -0
- package/node_modules/@types/keyv/node_modules/@types/node/http2.d.ts +2100 -0
- package/node_modules/@types/keyv/node_modules/@types/node/https.d.ts +391 -0
- package/node_modules/@types/keyv/node_modules/@types/node/index.d.ts +131 -0
- package/node_modules/@types/keyv/node_modules/@types/node/inspector.d.ts +2738 -0
- package/node_modules/@types/keyv/node_modules/@types/node/module.d.ts +114 -0
- package/node_modules/@types/keyv/node_modules/@types/node/net.d.ts +783 -0
- package/node_modules/@types/keyv/node_modules/@types/node/os.d.ts +455 -0
- package/node_modules/@types/keyv/node_modules/@types/node/package.json +230 -0
- package/node_modules/@types/keyv/node_modules/@types/node/path.d.ts +172 -0
- package/node_modules/@types/keyv/node_modules/@types/node/perf_hooks.d.ts +555 -0
- package/node_modules/@types/keyv/node_modules/@types/node/process.d.ts +1477 -0
- package/node_modules/@types/keyv/node_modules/@types/node/punycode.d.ts +117 -0
- package/node_modules/@types/keyv/node_modules/@types/node/querystring.d.ts +131 -0
- package/node_modules/@types/keyv/node_modules/@types/node/readline.d.ts +542 -0
- package/node_modules/@types/keyv/node_modules/@types/node/repl.d.ts +424 -0
- package/node_modules/@types/keyv/node_modules/@types/node/stream/consumers.d.ts +24 -0
- package/node_modules/@types/keyv/node_modules/@types/node/stream/promises.d.ts +42 -0
- package/node_modules/@types/keyv/node_modules/@types/node/stream/web.d.ts +6 -0
- package/node_modules/@types/keyv/node_modules/@types/node/stream.d.ts +1249 -0
- package/node_modules/@types/keyv/node_modules/@types/node/string_decoder.d.ts +67 -0
- package/node_modules/@types/keyv/node_modules/@types/node/timers/promises.d.ts +68 -0
- package/node_modules/@types/keyv/node_modules/@types/node/timers.d.ts +94 -0
- package/node_modules/@types/keyv/node_modules/@types/node/tls.d.ts +1019 -0
- package/node_modules/@types/keyv/node_modules/@types/node/trace_events.d.ts +161 -0
- package/node_modules/@types/keyv/node_modules/@types/node/tty.d.ts +204 -0
- package/node_modules/@types/keyv/node_modules/@types/node/url.d.ts +798 -0
- package/node_modules/@types/keyv/node_modules/@types/node/util.d.ts +1563 -0
- package/node_modules/@types/keyv/node_modules/@types/node/v8.d.ts +378 -0
- package/node_modules/@types/keyv/node_modules/@types/node/vm.d.ts +507 -0
- package/node_modules/@types/keyv/node_modules/@types/node/wasi.d.ts +158 -0
- package/node_modules/@types/keyv/node_modules/@types/node/worker_threads.d.ts +649 -0
- package/node_modules/@types/keyv/node_modules/@types/node/zlib.d.ts +517 -0
- package/node_modules/@types/keyv/package.json +32 -0
- package/node_modules/@types/responselike/LICENSE +21 -0
- package/node_modules/@types/responselike/README.md +16 -0
- package/node_modules/@types/responselike/index.d.ts +34 -0
- package/node_modules/@types/responselike/node_modules/@types/node/LICENSE +21 -0
- package/node_modules/@types/responselike/node_modules/@types/node/README.md +16 -0
- package/node_modules/@types/responselike/node_modules/@types/node/assert/strict.d.ts +8 -0
- package/node_modules/@types/responselike/node_modules/@types/node/assert.d.ts +912 -0
- package/node_modules/@types/responselike/node_modules/@types/node/async_hooks.d.ts +497 -0
- package/node_modules/@types/responselike/node_modules/@types/node/buffer.d.ts +2142 -0
- package/node_modules/@types/responselike/node_modules/@types/node/child_process.d.ts +1365 -0
- package/node_modules/@types/responselike/node_modules/@types/node/cluster.d.ts +414 -0
- package/node_modules/@types/responselike/node_modules/@types/node/console.d.ts +412 -0
- package/node_modules/@types/responselike/node_modules/@types/node/constants.d.ts +18 -0
- package/node_modules/@types/responselike/node_modules/@types/node/crypto.d.ts +3307 -0
- package/node_modules/@types/responselike/node_modules/@types/node/dgram.d.ts +545 -0
- package/node_modules/@types/responselike/node_modules/@types/node/diagnostics_channel.d.ts +128 -0
- package/node_modules/@types/responselike/node_modules/@types/node/dns/promises.d.ts +357 -0
- package/node_modules/@types/responselike/node_modules/@types/node/dns.d.ts +643 -0
- package/node_modules/@types/responselike/node_modules/@types/node/domain.d.ts +169 -0
- package/node_modules/@types/responselike/node_modules/@types/node/events.d.ts +623 -0
- package/node_modules/@types/responselike/node_modules/@types/node/fs/promises.d.ts +1004 -0
- package/node_modules/@types/responselike/node_modules/@types/node/fs.d.ts +3748 -0
- package/node_modules/@types/responselike/node_modules/@types/node/globals.d.ts +284 -0
- package/node_modules/@types/responselike/node_modules/@types/node/globals.global.d.ts +1 -0
- package/node_modules/@types/responselike/node_modules/@types/node/http.d.ts +1368 -0
- package/node_modules/@types/responselike/node_modules/@types/node/http2.d.ts +2100 -0
- package/node_modules/@types/responselike/node_modules/@types/node/https.d.ts +391 -0
- package/node_modules/@types/responselike/node_modules/@types/node/index.d.ts +131 -0
- package/node_modules/@types/responselike/node_modules/@types/node/inspector.d.ts +2738 -0
- package/node_modules/@types/responselike/node_modules/@types/node/module.d.ts +114 -0
- package/node_modules/@types/responselike/node_modules/@types/node/net.d.ts +783 -0
- package/node_modules/@types/responselike/node_modules/@types/node/os.d.ts +455 -0
- package/node_modules/@types/responselike/node_modules/@types/node/package.json +230 -0
- package/node_modules/@types/responselike/node_modules/@types/node/path.d.ts +172 -0
- package/node_modules/@types/responselike/node_modules/@types/node/perf_hooks.d.ts +555 -0
- package/node_modules/@types/responselike/node_modules/@types/node/process.d.ts +1477 -0
- package/node_modules/@types/responselike/node_modules/@types/node/punycode.d.ts +117 -0
- package/node_modules/@types/responselike/node_modules/@types/node/querystring.d.ts +131 -0
- package/node_modules/@types/responselike/node_modules/@types/node/readline.d.ts +542 -0
- package/node_modules/@types/responselike/node_modules/@types/node/repl.d.ts +424 -0
- package/node_modules/@types/responselike/node_modules/@types/node/stream/consumers.d.ts +24 -0
- package/node_modules/@types/responselike/node_modules/@types/node/stream/promises.d.ts +42 -0
- package/node_modules/@types/responselike/node_modules/@types/node/stream/web.d.ts +6 -0
- package/node_modules/@types/responselike/node_modules/@types/node/stream.d.ts +1249 -0
- package/node_modules/@types/responselike/node_modules/@types/node/string_decoder.d.ts +67 -0
- package/node_modules/@types/responselike/node_modules/@types/node/timers/promises.d.ts +68 -0
- package/node_modules/@types/responselike/node_modules/@types/node/timers.d.ts +94 -0
- package/node_modules/@types/responselike/node_modules/@types/node/tls.d.ts +1019 -0
- package/node_modules/@types/responselike/node_modules/@types/node/trace_events.d.ts +161 -0
- package/node_modules/@types/responselike/node_modules/@types/node/tty.d.ts +204 -0
- package/node_modules/@types/responselike/node_modules/@types/node/url.d.ts +798 -0
- package/node_modules/@types/responselike/node_modules/@types/node/util.d.ts +1563 -0
- package/node_modules/@types/responselike/node_modules/@types/node/v8.d.ts +378 -0
- package/node_modules/@types/responselike/node_modules/@types/node/vm.d.ts +507 -0
- package/node_modules/@types/responselike/node_modules/@types/node/wasi.d.ts +158 -0
- package/node_modules/@types/responselike/node_modules/@types/node/worker_threads.d.ts +649 -0
- package/node_modules/@types/responselike/node_modules/@types/node/zlib.d.ts +517 -0
- package/node_modules/@types/responselike/package.json +25 -0
- package/node_modules/cacheable-lookup/LICENSE +21 -0
- package/node_modules/cacheable-lookup/README.md +240 -0
- package/node_modules/cacheable-lookup/index.d.ts +139 -0
- package/node_modules/cacheable-lookup/package.json +45 -0
- package/node_modules/cacheable-lookup/source/index.js +436 -0
- package/node_modules/cacheable-request/LICENSE +21 -0
- package/node_modules/cacheable-request/README.md +206 -0
- package/node_modules/cacheable-request/package.json +56 -0
- package/node_modules/cacheable-request/src/index.js +251 -0
- package/node_modules/clone-response/LICENSE +21 -0
- package/node_modules/clone-response/README.md +62 -0
- package/node_modules/clone-response/package.json +44 -0
- package/node_modules/clone-response/src/index.js +17 -0
- package/node_modules/decompress-response/index.d.ts +22 -0
- package/node_modules/decompress-response/index.js +58 -0
- package/node_modules/decompress-response/license +9 -0
- package/node_modules/decompress-response/node_modules/mimic-response/index.d.ts +17 -0
- package/node_modules/decompress-response/node_modules/mimic-response/index.js +77 -0
- package/node_modules/decompress-response/node_modules/mimic-response/license +9 -0
- package/node_modules/decompress-response/node_modules/mimic-response/package.json +42 -0
- package/node_modules/decompress-response/node_modules/mimic-response/readme.md +78 -0
- package/node_modules/decompress-response/package.json +56 -0
- package/node_modules/decompress-response/readme.md +48 -0
- package/node_modules/defer-to-connect/LICENSE +21 -0
- package/node_modules/defer-to-connect/README.md +38 -0
- package/node_modules/defer-to-connect/dist/source/index.d.ts +10 -0
- package/node_modules/defer-to-connect/dist/source/index.js +47 -0
- package/node_modules/defer-to-connect/package.json +71 -0
- package/node_modules/end-of-stream/LICENSE +21 -0
- package/node_modules/end-of-stream/README.md +54 -0
- package/node_modules/end-of-stream/index.js +94 -0
- package/node_modules/end-of-stream/package.json +37 -0
- package/node_modules/get-stream/buffer-stream.js +52 -0
- package/node_modules/get-stream/index.d.ts +108 -0
- package/node_modules/get-stream/index.js +60 -0
- package/node_modules/get-stream/license +9 -0
- package/node_modules/get-stream/package.json +50 -0
- package/node_modules/get-stream/readme.md +124 -0
- package/node_modules/got/dist/source/as-promise/create-rejection.d.ts +2 -0
- package/node_modules/got/dist/source/as-promise/create-rejection.js +30 -0
- package/node_modules/got/dist/source/as-promise/index.d.ts +3 -0
- package/node_modules/got/dist/source/as-promise/index.js +175 -0
- package/node_modules/got/dist/source/as-promise/normalize-arguments.d.ts +3 -0
- package/node_modules/got/dist/source/as-promise/normalize-arguments.js +78 -0
- package/node_modules/got/dist/source/as-promise/parse-body.d.ts +3 -0
- package/node_modules/got/dist/source/as-promise/parse-body.js +25 -0
- package/node_modules/got/dist/source/as-promise/types.d.ts +256 -0
- package/node_modules/got/dist/source/as-promise/types.js +40 -0
- package/node_modules/got/dist/source/core/calculate-retry-delay.d.ts +5 -0
- package/node_modules/got/dist/source/core/calculate-retry-delay.js +29 -0
- package/node_modules/got/dist/source/core/index.d.ts +1124 -0
- package/node_modules/got/dist/source/core/index.js +1491 -0
- package/node_modules/got/dist/source/core/utils/dns-ip-version.d.ts +5 -0
- package/node_modules/got/dist/source/core/utils/dns-ip-version.js +17 -0
- package/node_modules/got/dist/source/core/utils/get-body-size.d.ts +3 -0
- package/node_modules/got/dist/source/core/utils/get-body-size.js +32 -0
- package/node_modules/got/dist/source/core/utils/get-buffer.d.ts +4 -0
- package/node_modules/got/dist/source/core/utils/get-buffer.js +16 -0
- package/node_modules/got/dist/source/core/utils/is-form-data.d.ts +8 -0
- package/node_modules/got/dist/source/core/utils/is-form-data.js +4 -0
- package/node_modules/got/dist/source/core/utils/is-response-ok.d.ts +2 -0
- package/node_modules/got/dist/source/core/utils/is-response-ok.js +8 -0
- package/node_modules/got/dist/source/core/utils/options-to-url.d.ts +14 -0
- package/node_modules/got/dist/source/core/utils/options-to-url.js +53 -0
- package/node_modules/got/dist/source/core/utils/proxy-events.d.ts +3 -0
- package/node_modules/got/dist/source/core/utils/proxy-events.js +17 -0
- package/node_modules/got/dist/source/core/utils/timed-out.d.ts +29 -0
- package/node_modules/got/dist/source/core/utils/timed-out.js +121 -0
- package/node_modules/got/dist/source/core/utils/unhandle.d.ts +11 -0
- package/node_modules/got/dist/source/core/utils/unhandle.js +22 -0
- package/node_modules/got/dist/source/core/utils/url-to-options.d.ts +15 -0
- package/node_modules/got/dist/source/core/utils/url-to-options.js +24 -0
- package/node_modules/got/dist/source/core/utils/weakable-map.d.ts +8 -0
- package/node_modules/got/dist/source/core/utils/weakable-map.js +29 -0
- package/node_modules/got/dist/source/create.d.ts +5 -0
- package/node_modules/got/dist/source/create.js +240 -0
- package/node_modules/got/dist/source/index.d.ts +4 -0
- package/node_modules/got/dist/source/index.js +132 -0
- package/node_modules/got/dist/source/types.d.ts +342 -0
- package/node_modules/got/dist/source/types.js +2 -0
- package/node_modules/got/dist/source/utils/deep-freeze.d.ts +1 -0
- package/node_modules/got/dist/source/utils/deep-freeze.js +12 -0
- package/node_modules/got/dist/source/utils/deprecation-warning.d.ts +2 -0
- package/node_modules/got/dist/source/utils/deprecation-warning.js +13 -0
- package/node_modules/got/license +9 -0
- package/node_modules/got/package.json +130 -0
- package/node_modules/got/readme.md +2476 -0
- package/node_modules/http-cache-semantics/LICENSE +9 -0
- package/node_modules/http-cache-semantics/README.md +203 -0
- package/node_modules/http-cache-semantics/index.js +673 -0
- package/node_modules/http-cache-semantics/package.json +24 -0
- package/node_modules/http2-wrapper/LICENSE +21 -0
- package/node_modules/http2-wrapper/README.md +470 -0
- package/node_modules/http2-wrapper/package.json +54 -0
- package/node_modules/http2-wrapper/source/agent.js +670 -0
- package/node_modules/http2-wrapper/source/auto.js +149 -0
- package/node_modules/http2-wrapper/source/client-request.js +445 -0
- package/node_modules/http2-wrapper/source/incoming-message.js +58 -0
- package/node_modules/http2-wrapper/source/index.js +28 -0
- package/node_modules/http2-wrapper/source/utils/calculate-server-name.js +27 -0
- package/node_modules/http2-wrapper/source/utils/errors.js +45 -0
- package/node_modules/http2-wrapper/source/utils/is-request-pseudo-header.js +13 -0
- package/node_modules/http2-wrapper/source/utils/proxy-events.js +7 -0
- package/node_modules/http2-wrapper/source/utils/url-to-options.js +25 -0
- package/node_modules/json-buffer/.travis.yml +3 -0
- package/node_modules/json-buffer/LICENSE +22 -0
- package/node_modules/json-buffer/README.md +24 -0
- package/node_modules/json-buffer/index.js +58 -0
- package/node_modules/json-buffer/package.json +34 -0
- package/node_modules/json-buffer/test/index.js +63 -0
- package/node_modules/keyv/LICENSE +21 -0
- package/node_modules/keyv/README.md +288 -0
- package/node_modules/keyv/package.json +49 -0
- package/node_modules/keyv/src/index.js +111 -0
- package/node_modules/lowercase-keys/index.d.ts +16 -0
- package/node_modules/lowercase-keys/index.js +10 -0
- package/node_modules/lowercase-keys/license +9 -0
- package/node_modules/lowercase-keys/package.json +38 -0
- package/node_modules/lowercase-keys/readme.md +32 -0
- package/node_modules/mimic-response/index.js +32 -0
- package/node_modules/mimic-response/license +9 -0
- package/node_modules/mimic-response/package.json +37 -0
- package/node_modules/mimic-response/readme.md +54 -0
- package/node_modules/normalize-url/index.d.ts +267 -0
- package/node_modules/normalize-url/index.js +216 -0
- package/node_modules/normalize-url/license +9 -0
- package/node_modules/normalize-url/package.json +50 -0
- package/node_modules/normalize-url/readme.md +286 -0
- package/node_modules/once/LICENSE +15 -0
- package/node_modules/once/README.md +79 -0
- package/node_modules/once/once.js +42 -0
- package/node_modules/once/package.json +33 -0
- package/node_modules/p-cancelable/index.d.ts +176 -0
- package/node_modules/p-cancelable/index.js +111 -0
- package/node_modules/p-cancelable/license +9 -0
- package/node_modules/p-cancelable/package.json +49 -0
- package/node_modules/p-cancelable/readme.md +153 -0
- package/node_modules/pump/.travis.yml +5 -0
- package/node_modules/pump/LICENSE +21 -0
- package/node_modules/pump/README.md +65 -0
- package/node_modules/pump/index.js +82 -0
- package/node_modules/pump/package.json +24 -0
- package/node_modules/pump/test-browser.js +66 -0
- package/node_modules/pump/test-node.js +53 -0
- package/node_modules/quick-lru/index.d.ts +97 -0
- package/node_modules/quick-lru/index.js +123 -0
- package/node_modules/quick-lru/license +9 -0
- package/node_modules/quick-lru/package.json +43 -0
- package/node_modules/quick-lru/readme.md +111 -0
- package/node_modules/resolve-alpn/LICENSE +22 -0
- package/node_modules/resolve-alpn/README.md +60 -0
- package/node_modules/resolve-alpn/index.js +43 -0
- package/node_modules/resolve-alpn/package.json +34 -0
- package/node_modules/responselike/LICENSE +19 -0
- package/node_modules/responselike/README.md +77 -0
- package/node_modules/responselike/package.json +38 -0
- package/node_modules/responselike/src/index.js +34 -0
- package/node_modules/wrappy/LICENSE +15 -0
- package/node_modules/wrappy/README.md +36 -0
- package/node_modules/wrappy/package.json +29 -0
- package/node_modules/wrappy/wrappy.js +33 -0
- package/package.json +7 -4
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs
|
|
4
|
+
const DATA_URL_DEFAULT_MIME_TYPE = 'text/plain';
|
|
5
|
+
const DATA_URL_DEFAULT_CHARSET = 'us-ascii';
|
|
6
|
+
|
|
7
|
+
const testParameter = (name, filters) => {
|
|
8
|
+
return filters.some(filter => filter instanceof RegExp ? filter.test(name) : filter === name);
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const normalizeDataURL = (urlString, {stripHash}) => {
|
|
12
|
+
const match = /^data:(?<type>[^,]*?),(?<data>[^#]*?)(?:#(?<hash>.*))?$/.exec(urlString);
|
|
13
|
+
|
|
14
|
+
if (!match) {
|
|
15
|
+
throw new Error(`Invalid URL: ${urlString}`);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
let {type, data, hash} = match.groups;
|
|
19
|
+
const mediaType = type.split(';');
|
|
20
|
+
hash = stripHash ? '' : hash;
|
|
21
|
+
|
|
22
|
+
let isBase64 = false;
|
|
23
|
+
if (mediaType[mediaType.length - 1] === 'base64') {
|
|
24
|
+
mediaType.pop();
|
|
25
|
+
isBase64 = true;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Lowercase MIME type
|
|
29
|
+
const mimeType = (mediaType.shift() || '').toLowerCase();
|
|
30
|
+
const attributes = mediaType
|
|
31
|
+
.map(attribute => {
|
|
32
|
+
let [key, value = ''] = attribute.split('=').map(string => string.trim());
|
|
33
|
+
|
|
34
|
+
// Lowercase `charset`
|
|
35
|
+
if (key === 'charset') {
|
|
36
|
+
value = value.toLowerCase();
|
|
37
|
+
|
|
38
|
+
if (value === DATA_URL_DEFAULT_CHARSET) {
|
|
39
|
+
return '';
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return `${key}${value ? `=${value}` : ''}`;
|
|
44
|
+
})
|
|
45
|
+
.filter(Boolean);
|
|
46
|
+
|
|
47
|
+
const normalizedMediaType = [
|
|
48
|
+
...attributes
|
|
49
|
+
];
|
|
50
|
+
|
|
51
|
+
if (isBase64) {
|
|
52
|
+
normalizedMediaType.push('base64');
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (normalizedMediaType.length !== 0 || (mimeType && mimeType !== DATA_URL_DEFAULT_MIME_TYPE)) {
|
|
56
|
+
normalizedMediaType.unshift(mimeType);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return `data:${normalizedMediaType.join(';')},${isBase64 ? data.trim() : data}${hash ? `#${hash}` : ''}`;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const normalizeUrl = (urlString, options) => {
|
|
63
|
+
options = {
|
|
64
|
+
defaultProtocol: 'http:',
|
|
65
|
+
normalizeProtocol: true,
|
|
66
|
+
forceHttp: false,
|
|
67
|
+
forceHttps: false,
|
|
68
|
+
stripAuthentication: true,
|
|
69
|
+
stripHash: false,
|
|
70
|
+
stripTextFragment: true,
|
|
71
|
+
stripWWW: true,
|
|
72
|
+
removeQueryParameters: [/^utm_\w+/i],
|
|
73
|
+
removeTrailingSlash: true,
|
|
74
|
+
removeSingleSlash: true,
|
|
75
|
+
removeDirectoryIndex: false,
|
|
76
|
+
sortQueryParameters: true,
|
|
77
|
+
...options
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
urlString = urlString.trim();
|
|
81
|
+
|
|
82
|
+
// Data URL
|
|
83
|
+
if (/^data:/i.test(urlString)) {
|
|
84
|
+
return normalizeDataURL(urlString, options);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (/^view-source:/i.test(urlString)) {
|
|
88
|
+
throw new Error('`view-source:` is not supported as it is a non-standard protocol');
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const hasRelativeProtocol = urlString.startsWith('//');
|
|
92
|
+
const isRelativeUrl = !hasRelativeProtocol && /^\.*\//.test(urlString);
|
|
93
|
+
|
|
94
|
+
// Prepend protocol
|
|
95
|
+
if (!isRelativeUrl) {
|
|
96
|
+
urlString = urlString.replace(/^(?!(?:\w+:)?\/\/)|^\/\//, options.defaultProtocol);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const urlObj = new URL(urlString);
|
|
100
|
+
|
|
101
|
+
if (options.forceHttp && options.forceHttps) {
|
|
102
|
+
throw new Error('The `forceHttp` and `forceHttps` options cannot be used together');
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if (options.forceHttp && urlObj.protocol === 'https:') {
|
|
106
|
+
urlObj.protocol = 'http:';
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if (options.forceHttps && urlObj.protocol === 'http:') {
|
|
110
|
+
urlObj.protocol = 'https:';
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// Remove auth
|
|
114
|
+
if (options.stripAuthentication) {
|
|
115
|
+
urlObj.username = '';
|
|
116
|
+
urlObj.password = '';
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// Remove hash
|
|
120
|
+
if (options.stripHash) {
|
|
121
|
+
urlObj.hash = '';
|
|
122
|
+
} else if (options.stripTextFragment) {
|
|
123
|
+
urlObj.hash = urlObj.hash.replace(/#?:~:text.*?$/i, '');
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// Remove duplicate slashes if not preceded by a protocol
|
|
127
|
+
if (urlObj.pathname) {
|
|
128
|
+
urlObj.pathname = urlObj.pathname.replace(/(?<!\b(?:[a-z][a-z\d+\-.]{1,50}:))\/{2,}/g, '/');
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// Decode URI octets
|
|
132
|
+
if (urlObj.pathname) {
|
|
133
|
+
try {
|
|
134
|
+
urlObj.pathname = decodeURI(urlObj.pathname);
|
|
135
|
+
} catch (_) {}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// Remove directory index
|
|
139
|
+
if (options.removeDirectoryIndex === true) {
|
|
140
|
+
options.removeDirectoryIndex = [/^index\.[a-z]+$/];
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
if (Array.isArray(options.removeDirectoryIndex) && options.removeDirectoryIndex.length > 0) {
|
|
144
|
+
let pathComponents = urlObj.pathname.split('/');
|
|
145
|
+
const lastComponent = pathComponents[pathComponents.length - 1];
|
|
146
|
+
|
|
147
|
+
if (testParameter(lastComponent, options.removeDirectoryIndex)) {
|
|
148
|
+
pathComponents = pathComponents.slice(0, pathComponents.length - 1);
|
|
149
|
+
urlObj.pathname = pathComponents.slice(1).join('/') + '/';
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
if (urlObj.hostname) {
|
|
154
|
+
// Remove trailing dot
|
|
155
|
+
urlObj.hostname = urlObj.hostname.replace(/\.$/, '');
|
|
156
|
+
|
|
157
|
+
// Remove `www.`
|
|
158
|
+
if (options.stripWWW && /^www\.(?!www\.)(?:[a-z\-\d]{1,63})\.(?:[a-z.\-\d]{2,63})$/.test(urlObj.hostname)) {
|
|
159
|
+
// Each label should be max 63 at length (min: 1).
|
|
160
|
+
// Source: https://en.wikipedia.org/wiki/Hostname#Restrictions_on_valid_host_names
|
|
161
|
+
// Each TLD should be up to 63 characters long (min: 2).
|
|
162
|
+
// It is technically possible to have a single character TLD, but none currently exist.
|
|
163
|
+
urlObj.hostname = urlObj.hostname.replace(/^www\./, '');
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// Remove query unwanted parameters
|
|
168
|
+
if (Array.isArray(options.removeQueryParameters)) {
|
|
169
|
+
for (const key of [...urlObj.searchParams.keys()]) {
|
|
170
|
+
if (testParameter(key, options.removeQueryParameters)) {
|
|
171
|
+
urlObj.searchParams.delete(key);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
if (options.removeQueryParameters === true) {
|
|
177
|
+
urlObj.search = '';
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// Sort query parameters
|
|
181
|
+
if (options.sortQueryParameters) {
|
|
182
|
+
urlObj.searchParams.sort();
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
if (options.removeTrailingSlash) {
|
|
186
|
+
urlObj.pathname = urlObj.pathname.replace(/\/$/, '');
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
const oldUrlString = urlString;
|
|
190
|
+
|
|
191
|
+
// Take advantage of many of the Node `url` normalizations
|
|
192
|
+
urlString = urlObj.toString();
|
|
193
|
+
|
|
194
|
+
if (!options.removeSingleSlash && urlObj.pathname === '/' && !oldUrlString.endsWith('/') && urlObj.hash === '') {
|
|
195
|
+
urlString = urlString.replace(/\/$/, '');
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// Remove ending `/` unless removeSingleSlash is false
|
|
199
|
+
if ((options.removeTrailingSlash || urlObj.pathname === '/') && urlObj.hash === '' && options.removeSingleSlash) {
|
|
200
|
+
urlString = urlString.replace(/\/$/, '');
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// Restore relative protocol, if applicable
|
|
204
|
+
if (hasRelativeProtocol && !options.normalizeProtocol) {
|
|
205
|
+
urlString = urlString.replace(/^http:\/\//, '//');
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
// Remove http/https
|
|
209
|
+
if (options.stripProtocol) {
|
|
210
|
+
urlString = urlString.replace(/^(?:https?:)?\/\//, '');
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
return urlString;
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
module.exports = normalizeUrl;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "normalize-url",
|
|
3
|
+
"version": "6.1.0",
|
|
4
|
+
"description": "Normalize a URL",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": "sindresorhus/normalize-url",
|
|
7
|
+
"funding": "https://github.com/sponsors/sindresorhus",
|
|
8
|
+
"author": {
|
|
9
|
+
"name": "Sindre Sorhus",
|
|
10
|
+
"email": "sindresorhus@gmail.com",
|
|
11
|
+
"url": "https://sindresorhus.com"
|
|
12
|
+
},
|
|
13
|
+
"engines": {
|
|
14
|
+
"node": ">=10"
|
|
15
|
+
},
|
|
16
|
+
"scripts": {
|
|
17
|
+
"test": "xo && nyc ava && tsd"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"index.js",
|
|
21
|
+
"index.d.ts"
|
|
22
|
+
],
|
|
23
|
+
"keywords": [
|
|
24
|
+
"normalize",
|
|
25
|
+
"url",
|
|
26
|
+
"uri",
|
|
27
|
+
"address",
|
|
28
|
+
"string",
|
|
29
|
+
"normalization",
|
|
30
|
+
"normalisation",
|
|
31
|
+
"query",
|
|
32
|
+
"querystring",
|
|
33
|
+
"simplify",
|
|
34
|
+
"strip",
|
|
35
|
+
"trim",
|
|
36
|
+
"canonical"
|
|
37
|
+
],
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"ava": "^2.4.0",
|
|
40
|
+
"nyc": "^15.0.0",
|
|
41
|
+
"tsd": "^0.11.0",
|
|
42
|
+
"xo": "^0.25.3"
|
|
43
|
+
},
|
|
44
|
+
"nyc": {
|
|
45
|
+
"reporter": [
|
|
46
|
+
"text",
|
|
47
|
+
"lcov"
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
# normalize-url [](https://codecov.io/gh/sindresorhus/normalize-url)
|
|
2
|
+
|
|
3
|
+
> [Normalize](https://en.wikipedia.org/wiki/URL_normalization) a URL
|
|
4
|
+
|
|
5
|
+
Useful when you need to display, store, deduplicate, sort, compare, etc, URLs.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
$ npm install normalize-url
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
*If you need to use this in the browser, use version 4: `npm i normalize-url@4`*
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```js
|
|
18
|
+
const normalizeUrl = require('normalize-url');
|
|
19
|
+
|
|
20
|
+
normalizeUrl('sindresorhus.com');
|
|
21
|
+
//=> 'http://sindresorhus.com'
|
|
22
|
+
|
|
23
|
+
normalizeUrl('//www.sindresorhus.com:80/../baz?b=bar&a=foo');
|
|
24
|
+
//=> 'http://sindresorhus.com/baz?a=foo&b=bar'
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## API
|
|
28
|
+
|
|
29
|
+
### normalizeUrl(url, options?)
|
|
30
|
+
|
|
31
|
+
#### url
|
|
32
|
+
|
|
33
|
+
Type: `string`
|
|
34
|
+
|
|
35
|
+
URL to normalize, including [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs).
|
|
36
|
+
|
|
37
|
+
#### options
|
|
38
|
+
|
|
39
|
+
Type: `object`
|
|
40
|
+
|
|
41
|
+
##### defaultProtocol
|
|
42
|
+
|
|
43
|
+
Type: `string`\
|
|
44
|
+
Default: `http:`
|
|
45
|
+
|
|
46
|
+
##### normalizeProtocol
|
|
47
|
+
|
|
48
|
+
Type: `boolean`\
|
|
49
|
+
Default: `true`
|
|
50
|
+
|
|
51
|
+
Prepend `defaultProtocol` to the URL if it's protocol-relative.
|
|
52
|
+
|
|
53
|
+
```js
|
|
54
|
+
normalizeUrl('//sindresorhus.com:80/');
|
|
55
|
+
//=> 'http://sindresorhus.com'
|
|
56
|
+
|
|
57
|
+
normalizeUrl('//sindresorhus.com:80/', {normalizeProtocol: false});
|
|
58
|
+
//=> '//sindresorhus.com'
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
##### forceHttp
|
|
62
|
+
|
|
63
|
+
Type: `boolean`\
|
|
64
|
+
Default: `false`
|
|
65
|
+
|
|
66
|
+
Normalize `https:` to `http:`.
|
|
67
|
+
|
|
68
|
+
```js
|
|
69
|
+
normalizeUrl('https://sindresorhus.com:80/');
|
|
70
|
+
//=> 'https://sindresorhus.com'
|
|
71
|
+
|
|
72
|
+
normalizeUrl('https://sindresorhus.com:80/', {forceHttp: true});
|
|
73
|
+
//=> 'http://sindresorhus.com'
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
##### forceHttps
|
|
77
|
+
|
|
78
|
+
Type: `boolean`\
|
|
79
|
+
Default: `false`
|
|
80
|
+
|
|
81
|
+
Normalize `http:` to `https:`.
|
|
82
|
+
|
|
83
|
+
```js
|
|
84
|
+
normalizeUrl('https://sindresorhus.com:80/');
|
|
85
|
+
//=> 'https://sindresorhus.com'
|
|
86
|
+
|
|
87
|
+
normalizeUrl('http://sindresorhus.com:80/', {forceHttps: true});
|
|
88
|
+
//=> 'https://sindresorhus.com'
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
This option can't be used with the `forceHttp` option at the same time.
|
|
92
|
+
|
|
93
|
+
##### stripAuthentication
|
|
94
|
+
|
|
95
|
+
Type: `boolean`\
|
|
96
|
+
Default: `true`
|
|
97
|
+
|
|
98
|
+
Strip the [authentication](https://en.wikipedia.org/wiki/Basic_access_authentication) part of the URL.
|
|
99
|
+
|
|
100
|
+
```js
|
|
101
|
+
normalizeUrl('user:password@sindresorhus.com');
|
|
102
|
+
//=> 'https://sindresorhus.com'
|
|
103
|
+
|
|
104
|
+
normalizeUrl('user:password@sindresorhus.com', {stripAuthentication: false});
|
|
105
|
+
//=> 'https://user:password@sindresorhus.com'
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
##### stripHash
|
|
109
|
+
|
|
110
|
+
Type: `boolean`\
|
|
111
|
+
Default: `false`
|
|
112
|
+
|
|
113
|
+
Strip the hash part of the URL.
|
|
114
|
+
|
|
115
|
+
```js
|
|
116
|
+
normalizeUrl('sindresorhus.com/about.html#contact');
|
|
117
|
+
//=> 'http://sindresorhus.com/about.html#contact'
|
|
118
|
+
|
|
119
|
+
normalizeUrl('sindresorhus.com/about.html#contact', {stripHash: true});
|
|
120
|
+
//=> 'http://sindresorhus.com/about.html'
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
##### stripProtocol
|
|
124
|
+
|
|
125
|
+
Type: `boolean`\
|
|
126
|
+
Default: `false`
|
|
127
|
+
|
|
128
|
+
Remove HTTP(S) protocol from the URL: `http://sindresorhus.com` → `sindresorhus.com`.
|
|
129
|
+
|
|
130
|
+
```js
|
|
131
|
+
normalizeUrl('https://sindresorhus.com');
|
|
132
|
+
//=> 'https://sindresorhus.com'
|
|
133
|
+
|
|
134
|
+
normalizeUrl('https://sindresorhus.com', {stripProtocol: true});
|
|
135
|
+
//=> 'sindresorhus.com'
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
##### stripTextFragment
|
|
139
|
+
|
|
140
|
+
Type: `boolean`\
|
|
141
|
+
Default: `true`
|
|
142
|
+
|
|
143
|
+
Strip the [text fragment](https://web.dev/text-fragments/) part of the URL.
|
|
144
|
+
|
|
145
|
+
**Note:** The text fragment will always be removed if the `stripHash` option is set to `true`, as the hash contains the text fragment.
|
|
146
|
+
|
|
147
|
+
```js
|
|
148
|
+
normalizeUrl('http://sindresorhus.com/about.html#:~:text=hello');
|
|
149
|
+
//=> 'http://sindresorhus.com/about.html#'
|
|
150
|
+
|
|
151
|
+
normalizeUrl('http://sindresorhus.com/about.html#section:~:text=hello');
|
|
152
|
+
//=> 'http://sindresorhus.com/about.html#section'
|
|
153
|
+
|
|
154
|
+
normalizeUrl('http://sindresorhus.com/about.html#:~:text=hello', {stripTextFragment: false});
|
|
155
|
+
//=> 'http://sindresorhus.com/about.html#:~:text=hello'
|
|
156
|
+
|
|
157
|
+
normalizeUrl('http://sindresorhus.com/about.html#section:~:text=hello', {stripTextFragment: false});
|
|
158
|
+
//=> 'http://sindresorhus.com/about.html#section:~:text=hello'
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
##### stripWWW
|
|
162
|
+
|
|
163
|
+
Type: `boolean`\
|
|
164
|
+
Default: `true`
|
|
165
|
+
|
|
166
|
+
Remove `www.` from the URL.
|
|
167
|
+
|
|
168
|
+
```js
|
|
169
|
+
normalizeUrl('http://www.sindresorhus.com');
|
|
170
|
+
//=> 'http://sindresorhus.com'
|
|
171
|
+
|
|
172
|
+
normalizeUrl('http://www.sindresorhus.com', {stripWWW: false});
|
|
173
|
+
//=> 'http://www.sindresorhus.com'
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
##### removeQueryParameters
|
|
177
|
+
|
|
178
|
+
Type: `Array<RegExp | string> | boolean`\
|
|
179
|
+
Default: `[/^utm_\w+/i]`
|
|
180
|
+
|
|
181
|
+
Remove query parameters that matches any of the provided strings or regexes.
|
|
182
|
+
|
|
183
|
+
```js
|
|
184
|
+
normalizeUrl('www.sindresorhus.com?foo=bar&ref=test_ref', {
|
|
185
|
+
removeQueryParameters: ['ref']
|
|
186
|
+
});
|
|
187
|
+
//=> 'http://sindresorhus.com/?foo=bar'
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
If a boolean is provided, `true` will remove all the query parameters.
|
|
191
|
+
|
|
192
|
+
```js
|
|
193
|
+
normalizeUrl('www.sindresorhus.com?foo=bar', {
|
|
194
|
+
removeQueryParameters: true
|
|
195
|
+
});
|
|
196
|
+
//=> 'http://sindresorhus.com'
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
`false` will not remove any query parameter.
|
|
200
|
+
|
|
201
|
+
```js
|
|
202
|
+
normalizeUrl('www.sindresorhus.com?foo=bar&utm_medium=test&ref=test_ref', {
|
|
203
|
+
removeQueryParameters: false
|
|
204
|
+
});
|
|
205
|
+
//=> 'http://www.sindresorhus.com/?foo=bar&ref=test_ref&utm_medium=test'
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
##### removeTrailingSlash
|
|
209
|
+
|
|
210
|
+
Type: `boolean`\
|
|
211
|
+
Default: `true`
|
|
212
|
+
|
|
213
|
+
Remove trailing slash.
|
|
214
|
+
|
|
215
|
+
**Note:** Trailing slash is always removed if the URL doesn't have a pathname unless the `removeSingleSlash` option is set to `false`.
|
|
216
|
+
|
|
217
|
+
```js
|
|
218
|
+
normalizeUrl('http://sindresorhus.com/redirect/');
|
|
219
|
+
//=> 'http://sindresorhus.com/redirect'
|
|
220
|
+
|
|
221
|
+
normalizeUrl('http://sindresorhus.com/redirect/', {removeTrailingSlash: false});
|
|
222
|
+
//=> 'http://sindresorhus.com/redirect/'
|
|
223
|
+
|
|
224
|
+
normalizeUrl('http://sindresorhus.com/', {removeTrailingSlash: false});
|
|
225
|
+
//=> 'http://sindresorhus.com'
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
##### removeSingleSlash
|
|
229
|
+
|
|
230
|
+
Type: `boolean`\
|
|
231
|
+
Default: `true`
|
|
232
|
+
|
|
233
|
+
Remove a sole `/` pathname in the output. This option is independant of `removeTrailingSlash`.
|
|
234
|
+
|
|
235
|
+
```js
|
|
236
|
+
normalizeUrl('https://sindresorhus.com/');
|
|
237
|
+
//=> 'https://sindresorhus.com'
|
|
238
|
+
|
|
239
|
+
normalizeUrl('https://sindresorhus.com/', {removeSingleSlash: false});
|
|
240
|
+
//=> 'https://sindresorhus.com/'
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
##### removeDirectoryIndex
|
|
245
|
+
|
|
246
|
+
Type: `boolean | Array<RegExp | string>`\
|
|
247
|
+
Default: `false`
|
|
248
|
+
|
|
249
|
+
Removes the default directory index file from path that matches any of the provided strings or regexes. When `true`, the regex `/^index\.[a-z]+$/` is used.
|
|
250
|
+
|
|
251
|
+
```js
|
|
252
|
+
normalizeUrl('www.sindresorhus.com/foo/default.php', {
|
|
253
|
+
removeDirectoryIndex: [/^default\.[a-z]+$/]
|
|
254
|
+
});
|
|
255
|
+
//=> 'http://sindresorhus.com/foo'
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
##### sortQueryParameters
|
|
259
|
+
|
|
260
|
+
Type: `boolean`\
|
|
261
|
+
Default: `true`
|
|
262
|
+
|
|
263
|
+
Sorts the query parameters alphabetically by key.
|
|
264
|
+
|
|
265
|
+
```js
|
|
266
|
+
normalizeUrl('www.sindresorhus.com?b=two&a=one&c=three', {
|
|
267
|
+
sortQueryParameters: false
|
|
268
|
+
});
|
|
269
|
+
//=> 'http://sindresorhus.com/?b=two&a=one&c=three'
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
## Related
|
|
273
|
+
|
|
274
|
+
- [compare-urls](https://github.com/sindresorhus/compare-urls) - Compare URLs by first normalizing them
|
|
275
|
+
|
|
276
|
+
---
|
|
277
|
+
|
|
278
|
+
<div align="center">
|
|
279
|
+
<b>
|
|
280
|
+
<a href="https://tidelift.com/subscription/pkg/npm-normalize-url?utm_source=npm-normalize-url&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
|
|
281
|
+
</b>
|
|
282
|
+
<br>
|
|
283
|
+
<sub>
|
|
284
|
+
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
|
|
285
|
+
</sub>
|
|
286
|
+
</div>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
The ISC License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Isaac Z. Schlueter and Contributors
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
7
|
+
copyright notice and this permission notice appear in all copies.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
10
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
11
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
12
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
13
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
14
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
|
15
|
+
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# once
|
|
2
|
+
|
|
3
|
+
Only call a function once.
|
|
4
|
+
|
|
5
|
+
## usage
|
|
6
|
+
|
|
7
|
+
```javascript
|
|
8
|
+
var once = require('once')
|
|
9
|
+
|
|
10
|
+
function load (file, cb) {
|
|
11
|
+
cb = once(cb)
|
|
12
|
+
loader.load('file')
|
|
13
|
+
loader.once('load', cb)
|
|
14
|
+
loader.once('error', cb)
|
|
15
|
+
}
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Or add to the Function.prototype in a responsible way:
|
|
19
|
+
|
|
20
|
+
```javascript
|
|
21
|
+
// only has to be done once
|
|
22
|
+
require('once').proto()
|
|
23
|
+
|
|
24
|
+
function load (file, cb) {
|
|
25
|
+
cb = cb.once()
|
|
26
|
+
loader.load('file')
|
|
27
|
+
loader.once('load', cb)
|
|
28
|
+
loader.once('error', cb)
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Ironically, the prototype feature makes this module twice as
|
|
33
|
+
complicated as necessary.
|
|
34
|
+
|
|
35
|
+
To check whether you function has been called, use `fn.called`. Once the
|
|
36
|
+
function is called for the first time the return value of the original
|
|
37
|
+
function is saved in `fn.value` and subsequent calls will continue to
|
|
38
|
+
return this value.
|
|
39
|
+
|
|
40
|
+
```javascript
|
|
41
|
+
var once = require('once')
|
|
42
|
+
|
|
43
|
+
function load (cb) {
|
|
44
|
+
cb = once(cb)
|
|
45
|
+
var stream = createStream()
|
|
46
|
+
stream.once('data', cb)
|
|
47
|
+
stream.once('end', function () {
|
|
48
|
+
if (!cb.called) cb(new Error('not found'))
|
|
49
|
+
})
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## `once.strict(func)`
|
|
54
|
+
|
|
55
|
+
Throw an error if the function is called twice.
|
|
56
|
+
|
|
57
|
+
Some functions are expected to be called only once. Using `once` for them would
|
|
58
|
+
potentially hide logical errors.
|
|
59
|
+
|
|
60
|
+
In the example below, the `greet` function has to call the callback only once:
|
|
61
|
+
|
|
62
|
+
```javascript
|
|
63
|
+
function greet (name, cb) {
|
|
64
|
+
// return is missing from the if statement
|
|
65
|
+
// when no name is passed, the callback is called twice
|
|
66
|
+
if (!name) cb('Hello anonymous')
|
|
67
|
+
cb('Hello ' + name)
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function log (msg) {
|
|
71
|
+
console.log(msg)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// this will print 'Hello anonymous' but the logical error will be missed
|
|
75
|
+
greet(null, once(msg))
|
|
76
|
+
|
|
77
|
+
// once.strict will print 'Hello anonymous' and throw an error when the callback will be called the second time
|
|
78
|
+
greet(null, once.strict(msg))
|
|
79
|
+
```
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
var wrappy = require('wrappy')
|
|
2
|
+
module.exports = wrappy(once)
|
|
3
|
+
module.exports.strict = wrappy(onceStrict)
|
|
4
|
+
|
|
5
|
+
once.proto = once(function () {
|
|
6
|
+
Object.defineProperty(Function.prototype, 'once', {
|
|
7
|
+
value: function () {
|
|
8
|
+
return once(this)
|
|
9
|
+
},
|
|
10
|
+
configurable: true
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
Object.defineProperty(Function.prototype, 'onceStrict', {
|
|
14
|
+
value: function () {
|
|
15
|
+
return onceStrict(this)
|
|
16
|
+
},
|
|
17
|
+
configurable: true
|
|
18
|
+
})
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
function once (fn) {
|
|
22
|
+
var f = function () {
|
|
23
|
+
if (f.called) return f.value
|
|
24
|
+
f.called = true
|
|
25
|
+
return f.value = fn.apply(this, arguments)
|
|
26
|
+
}
|
|
27
|
+
f.called = false
|
|
28
|
+
return f
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function onceStrict (fn) {
|
|
32
|
+
var f = function () {
|
|
33
|
+
if (f.called)
|
|
34
|
+
throw new Error(f.onceError)
|
|
35
|
+
f.called = true
|
|
36
|
+
return f.value = fn.apply(this, arguments)
|
|
37
|
+
}
|
|
38
|
+
var name = fn.name || 'Function wrapped with `once`'
|
|
39
|
+
f.onceError = name + " shouldn't be called more than once"
|
|
40
|
+
f.called = false
|
|
41
|
+
return f
|
|
42
|
+
}
|